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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -