[Swift] UItable ViewCell의accessory View의tintColor 변경

3074 단어 SwiftUITableViewCell

Problem


UItable ViewCell의accessory View의tintColor를 변경하고 싶습니다

Solution


아이콘 가져오기


다음 사이트에서의 png 이미지 다운로드,ios용 아이콘 집합ic_navigate_next끌어 놓다
https://www.google.com/design/icons/#ic_navigate_next

이루어지다

  func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath)
    let disclosureImage = UIImage(named: "ic_navigate_next")!.imageWithRenderingMode(.AlwaysTemplate)
    let disclosureView = UIImageView(image: disclosureImage)
    disclosureView.tintColor = UIColor.redColor()
    cell.accessoryView = disclosureView
    return cell
  }

결실



참고 자료

  • UITableViewCell accessory not being tinted
  • UIImageView에서 설정한 이미지의 색상 변경
  • 좋은 웹페이지 즐겨찾기