- for (UIView *subview in self.searchBar.subviews)
- {
- if ([subview isKindOfClass:NSClassFromString(@"UISearchBarBackground")])
- {
- [subview removeFromSuperview];
- }
- if ([subview isKindOfClass:[UITextField class]]) {
- UITextField *textField = (UITextField *)subview;
- textField.borderStyle = UITextBorderStyleRoundedRect;
- UILabel *iView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 35, 20)];
- [iView setText:@"search"];
- [iView setFont:[UIFont systemFontOfSize:15.0]];
- [iView setTextColor:[UIColor grayColor]];
- textField.leftView = iView;
- textField.clearButtonMode = UITextFieldViewModeNever;
- textField.rightViewMode = UITextFieldViewModeAlways;
- textField.returnKeyType = UIReturnKeyDone;
- }
- }
IOS ---改UISearchBar的圆角方法
最新推荐文章于 2022-03-10 10:22:21 发布