tags:

views:

150

answers:

1

Hi,

I wanted to use a custom background for my UITextFields. This works fine except for the fact that I have to use UITextBorderStyleNone to make it look pretty. This forces the text to stick to the left without any padding.

Can I set a padding manually so that it looks similar to UITextBorderStyleRounded except for using my custom background image?

Thanks a lot in advance, Sebastian

+1  A: 

You can't set padding. Instead have a UIView which has your background image and the UITextField inside of it. Set the UITextField width as UIViewWidth-(paddingSize x 2) and the height similarly and then set it at point paddingSize,paddingSize.

Thomas Clayson
Simple, but very good idea. Thank you!
Sebastian Wramba