ios - Autolayout stretched selected image for UIButton -


creating button in interface builder image it's selected state no image it's default state causes said image come out distorted when in selected state. turning off autolayout fixes issue.

enter image description here

both buttons same size. button ibaction toggles selected state. grey box around view there i'd know touch activate button since button has no image it's default state.

project zip

2 questions 1. why auto layout f'ing how button content displayed? 2. how work in auto layout?

so instead of setting image property of uibutton, set backgroundimage property.

i think reason auto layout calculates intrinsic size of button without taking account image property, since added on foreground.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -