how to change UISearchBar from round to rectangle?

后端 未结 12 1730
没有蜡笔的小新
没有蜡笔的小新 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条回答
  •  萌比男神i
    2021-02-09 02:23

    Why not use the UIAppearance protocol?

    [[UITextField appearanceWhenContainedInInstancesOfClasses:@[[UISearchBar class]]] setBorderStyle:UITextBorderStyleRoundedRect];

提交回复
热议问题