how to change UISearchBar from round to rectangle?

后端 未结 12 1557
没有蜡笔的小新
没有蜡笔的小新 2021-02-09 01:54

i will like to know how do i need to change a UISearchBar from the default round curve to a rectangle.

\"enter

12条回答
  •  长发绾君心
    2021-02-09 02:17

    In the target image I don't see the default shadow, so I'll mention that setting the background property to nil will remove it. I needed to do this in my project and removing the image and manipulating the border works well. I had to cast the control to get to the background property.

    UITextField * x = (UITextField*)searchBarSubview;
    x.background = nil;
    

    @Keller thanks for the tip for finding the control.

提交回复
热议问题