iphone - iOS: Combine two UIButtons to one UIButton -
on storyboard have 2 uibuttons. in uiviewcontroller subclass have 1 ibaction method buttons. 1 of buttons has image , hasn't got title, has title hasn't got image. so, it's image behaves button , ordinary button.
both of buttons call method. problem if push 1 button, doesn't highlight. problem buttons have padding , me better if padding touchable (i mean space between image button , title button clickable).
i know can subclass uibutton , make buttons want, maybe there way make want without subclassing?
thanks.
1)
assign both buttons properties.
when ibaction fires, can set 1 or both buttons highlighted via controls' "highlighted" properties, or via sethighlighted:.
2)
as making space between buttons touchable, set alignment button graphic left aligned or right aligned (the latter i've done in example below) , these 2 separate buttons have edges touching.

3) or...
you can cheat , have 1 button , put space between image , button text, this:
yes, that's whole bunch of spaces (which i've highlighted in green) before word "button".
Comments
Post a Comment