Increase the distance between the icon and the cursor in the Objective-C search bar.

Increase the distance between the icon and the cursor in the search bar

So, I want to add a space between the searchIcon and the text that the user enters as too close together.

enter image description here

+4
source share
1 answer

Take a look at the link to Apple's UISearchBar class and find searchTextPositionAdjustment.

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

+8
source

All Articles