Ankit Gupta
Ankit Gupta

Reputation: 958

How to change Background Color and Placeholder position of UISearchBar

I am trying to add UISearchBar on storyboard but i see there is not much option for Background color, text placeholder. Can i do that without programming ?

Upvotes: 0

Views: 324

Answers (1)

user5938635
user5938635

Reputation:

yes in attribute inspector you can find all the properties and make changes in your searchbar according to your need

enter image description here

OR

You can create a custom UISearchBar for your app

//Custom search bar code
    UISearchBar *search = [[UISearchBar alloc] init];
    search.frame = CGRectMake(0, 200, 300,45);
    search.delegate = self;
    search.showsBookmarkButton = NO;
    search.placeholder = @"Search/Select a Creative Service";
    search.barTintColor = [UIColor whiteColor];
    [self.view addSubview:search];

Upvotes: 1

Related Questions