UITextView highlightedTextColor or similar option?

前端 未结 2 637
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 13:24

I have a custom UITableViewCell with a UILabel and a UITextView in it.

I want the text for both of these to appear white when the

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-06 14:11

    The solution posted by the author is half right for my situation. Need to keep in mind that the following events happen:

    1. press down --> setHighlighted:YES animated: is called
    2. press up --> setHighlighted:NO animated is called
    3. set selection --> setSelected:YES animated is called

    Knowing this, and depending on how you want the TableCell to look when highighted vs when selected will determine if you need to implement setHighlighted:animated:, setSelected:animated: or both methods.

    For the look I want, I need to implement both methods.

提交回复
热议问题