how to change UISearchBar from round to rectangle?

后端 未结 12 1539
没有蜡笔的小新
没有蜡笔的小新 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

    Simple add background image, left view and right view for your TextField.

    Example below

    UIView *leftView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 10., nameField.bounds.size.height)];
    nameField.leftView = leftView;
    nameField.leftViewMode = UITextFieldViewModeAlways;
    leftView release];
    

提交回复
热议问题