ios - UIButton image always to be 80 point away from title -


i have used method set image 80 point away title. button has blue color background here.

    self.btnerrormsg.imageedgeinsets = uiedgeinsetsmake(0, 0, 0, 80); 

enter image description here

problem if text longer, overlap text. how shall do?

enter image description here

you can use :

button.titleedgeinsets = uiedgeinsetsmake(cgfloat top, cgfloat left, cgfloat bottom, cgfloat right); 

it works me perfectly


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

ios - MKMapView fails to load tiles with HTTP 410 error -

c# - How to utilize EF and LINQ to add filters and specify tables, columns, filters and order by dynamically -