iOS 8 UITableViewRowAction: Swipe Left, Images?

后端 未结 3 2131
青春惊慌失措
青春惊慌失措 2021-02-08 16:56

I\'ve just come across this new API on iOS8. I cannot however find any solution on if it is possible to use images instead of text and to allow left and right swipe? Is this eve

相关标签:
3条回答
  • 2021-02-08 17:37

    When you are adding images to the swiped view, this answer may be helpful.

    0 讨论(0)
  • 2021-02-08 17:43

    No, I don't think it's possible to have a right swipe (with a UITableViewCell, anyway). However, you can use an image for the button by setting its background color using colorWithPatternImage:. The width of the button seems to be determined by the length of the title, so if you want to change the width (and not have any visible title), use a title that consists of as many spaces as you need.

    0 讨论(0)
  • 2021-02-08 17:56

    in Swift it would be:

    deleteAction.backgroundColor = UIColor(patternImage: UIImage(named:"sample")!)
    
    0 讨论(0)
提交回复
热议问题