I'm trying to customize UISearchBar but I"m having a hard time with it. 

![enter image description here](https://i.stack.imgur.com/A1Iia.png)

This is what my searchbar looks like currently. What I want to be able to do is set a uiimage on the entire uisearchbar. I tried setSearchFieldBackgroundImage but it does not affect the text field part of the searchbar. How can I put an image in the white part? I also want to extend the white part to the edge to have equal margins on all sides.