Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase spacing between icon and cursor in search bar Objective-C

Increase spacing between icon and cursor in search bar

So I want to add a space between the searchIcon and the text that the user enters as it's too close to one another.

enter image description here

like image 447
Robert Shaw Avatar asked May 27 '15 14:05

Robert Shaw


1 Answers

Take a look at the UISearchBar Class Reference by Apple and look for searchTextPositionAdjustment.

To create a gap of 10 pixels between the icon and the text you could do the following in your code: searchBar.searchTextPositionAdjustment = UIOffsetMake(10.0f, 0.0f);

like image 183
Peter Tutervai Avatar answered Oct 19 '22 03:10

Peter Tutervai