ios - UIButton width reporting incorrectly -


i'm trying create circular uibutton in xcode setting corner radius equal half button width. problem is, storyboard says width of button 200, reports 46.0 when access in uiviewcontroller.

i've tried getting width using button.bounds.size.width, button.frame.size.width, button.layer.frame.size.width, , button.bounds.width , they're same.

the crazy thing didn't have trouble after created test project , added big button. major difference think of project used auto layout, adding width constraint didn't change anything.

for reference, i'm using xcode 6.1, swift, , it's iphone-only app targeting ios 8.

your button ending 46 points wide @ runtime, want 200 points? make sure 200 pt width constraint on button high priority, dial compression resistance , dial down content hugging (i'm assuming content naturally make smaller size seeing).


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -