Mustafa
Mustafa

Reputation: 20564

Creating custom button with multiple labels

Is it possible to create a button with multiple labels? e.g. imageView, textLabel and detailTextLabel.

I don't think it's possible using interface builder, but maybe we can do it programmatically by adding the UIImage and UILabels to button's view. If i do write a custom UIButton class, what's the best way to handle the state changes?

Also, I'm just curious whether Apple will approve a custom button with multiple labels and an image.

Upvotes: 1

Views: 599

Answers (1)

Nava Carmon
Nava Carmon

Reputation: 4533

You can create a view with all these subviews and put on it a custom transparent button to get clicks on this view. To handle states you can draw the button semitransparent with some gray toned background to make an effect of disabled button. HTH

Upvotes: 2

Related Questions