ios - how to set the values for UIEdgeinset for button -


i wanted increase button touch area without without increasing original size.

when comes insets there many in button , there no clear documentation find on differences

  • content insets

  • title insets

  • image insets

so later on thought try on content inset. according other stack overflow answers settings negative value co-ordiantes(left,top,right,bottom) increase touch area of button without increasing width , height.

but interfacebuilder doesn't allow me enter values on all.

for example if enter -10 in left , couldn't enter -10 in right , others that.

i confused on can me unravel complexity

thanks

try this:

func setupbutton(button: uibutton) {     button.titleedgeinsets = uiedgeinsetsmake(top, left, bottom, right)     button.imageedgeinsets =  uiedgeinsetsmake(top, left, bottom, right)     button.contentedgeinsets =  uiedgeinsetsmake(top, left, bottom, right) } 

you can refer this link more elaborated answer.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -