Although I have set the background image property in UITextField
. It doesn't apply.I didn't use any coding. I have just selected an image.png
file as the backround image using Interface Builder. So,How to do it ?
And there is no background image property in UITextView
. So,How can I add background image to textView
?
Thanks for the help.
Please refer to the documentation of UITextField and you will find the following:
The default value for this property is UITextBorderStyleNone. If the value is set to the UITextBorderStyleRoundedRect style, the custom background image associated with the text field is ignored.
In Interface Builder, just below the place where you set the background image, there should be an option to select a border style, by default it is selected to RoundedRect, select another style and you can immediately see the background image.
Use this
textField.backgroundColor = [UIColor colorWithPatternImage:myImage];
where "myImage" is your image.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With