0

I'm trying to change the background color of a UITextField of a UIAlertController.

First, I added the UITextField using this code:

[alertController addTextFieldWithConfigurationHandler:^(UITextField *tfPrompt) {
    self.textField = tfPrompt;
}];

After, in another moment, I tried to change it's background color using this code:

[self.textField setBackgroundColor:[UIColor redColor]];

But this is what I got:

enter image description here


What I really want is to fill the whole background of this UITextField. Is this possible? Thanks for any advice!

Roberto Sampaio
  • 531
  • 1
  • 5
  • 15

1 Answers1

0

This is part of the UITextField's borderStyle attribute.

You can refer to this thread: how to set border style of a UITextfield.

Community
  • 1
  • 1
tgyhlsb
  • 1,905
  • 14
  • 21