Ok, I think I found a working solution (at least for my problem).
I subclass the UIButton
class (it works for me, since I use a custom back button anyway), and I override the titleRectForContentRect
method, which is called every time the title should be displayed (including after a state change, just before the display).
I added UILabel
to the button view to display the second line I want, and during titleRectForContentRect
, I calculate the correct frame
position for my label, I update the text font and text color based on the state of the button ( self.state
) and all that I need.
source share