ios - UIButton bottom right title alignment -


i'm having trouble understanding how set uibutton's title alignment in swift 3.

i'm looking align title bottom right corner. i've tried following code no success:

self.btn.contenthorizontalalignment = .right self.btn.contentverticalalignment = .bottom 

in storyboard, it's pretty straightforward , button looks there. when trying on device, title aligned right not bottom.

these answers (i want uibutton this, , http://stackoverflow.com/questions/4344847/iphone-sdk-uibutton-with-both-image-and-text-possible/4345891#4345891) suggest play around title edge insets.

i have not tried programmatically, in storyboard. setting bottom inset -6, button looks when trying on device. title looks outside button when viewed in storyboard.

clearly, can't right... right? must have missed something.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -