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.
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.
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
Post a Comment