Reputation: 724
Rounded edges are getting kind of old, and I want my program to have a modern edge. Any idea how this can be done?
To clarify: I want the exact functionality of UITextField without rounded corners.
EDIT: Sorry, I'm a dumbass. I couldn't find the button because the textbox wasn't selected.
{insert facepalm emoticon here}
Upvotes: 4
Views: 3250
Reputation: 9564
Just to help anyone who still runs into this, since it isn't clear enough you can use the Storyboard/Xib Interface Builder:
Upvotes: 8
Reputation: 1170
You can modify a standard UITextView created in Interface Builder in viewDidLoad as follows:
[_textField setBorderStyle:UITextBorderStyleNone];
[_textField setBackgroundColor:[UIColor whiteColor]];
This can also be set the border style and background color directly in Interface Builder.
Upvotes: 1
Reputation: 20004
You need to set a background image and the background color.
UITextField *txtSearchField = [self.searchDisplayController.searchBar valueForKey:@"_searchField"];
[txtSearchField setBackgroundColor:[UIColor whiteColor]];
[txtSearchField setBackground:[[UIImage alloc]init]];
Upvotes: -1
Reputation: 1807
Subclass UITextfield and override the drawrect: method. I think this should solve your problem.
Upvotes: 1
Reputation: 22405
You can just change the borderStyle property of your UITextfield, or provide your own background image by setting backgroundImage property, here is a ref UITextField reference
Upvotes: 2