I would like create a button with two independent labels. I want to set in one button, two separate texts in different colors. e.g.
[myButton setTitle: @"Title" forState: UIControlStateNormal];
[myButton setTitle2: @"Title2" forState: UIControlStateNormal];
Is it even possible? Maybe I should need to create a new control? Can anyone help me? I will be very grateful for a tutorial step by step.
If you wanted to do it all in Interface Builder you could place two UILabels where you want them in the view and then lay a UIButton over the top of them. Then with the Attributes Inspector change the UIButton's type to "Custom" and delete any existing label or placeholder text it has. This will make the button clear so both labels show through and you can set the UIButton's IBAction to do whatever you want to the two separate UILabels.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With