uiview - How to achieve UIButton / UILabel 'padding' in iPhone app -


There have been many views in my iPhone application, which requires padding, such as custom UI buttons, text left the coalition , And a UILB is a background color.

This may actually be a stupid question, but how can I apply 'padding' to move the text from the side to the left?

I am tired of using borders etc. without any success.

I know that I can make a cover view for my UILabel with a background color, but it seems that redundancy.

Many thanks.

I am using auto layout The solution was the UIButton 's contentEdgeInsets setting.

Example

  Button.contentEdgeInsets = UIEdgeInsetsMake (0.0f, 30.0f, 0.0f, 30.0f);  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -