获取UISearchBar上的UITextField

释放双眼,带上耳机,听听看~!
UITextField *searchField = [_searchBar valueForKey:@"_searchField"];
//获取只需要上面一句话
    searchField.tag = 100;
    searchField.textColor = fontBlackColor;
    searchField.backgroundColor = Bg_Grey;
    [searchField setLeftViewMode:UITextFieldViewModeNever];
    [searchField setRightViewMode:UITextFieldViewModeNever];
    [searchField setValue:fontGreyColor forKeyPath:@"_placeholderLabel.textColor"];
    [searchField becomeFirstResponder];
[searchField setValue:[UIFont systemFontOfSize:12]forKeyPath:@"_placeholderLabel.font"];
        [searchField setBorderStyle:UITextBorderStyleNone];
        searchField.layer.borderWidth = 3.0f;
        searchField.layer.cornerRadius = 10.0f;
        searchField.layer.borderColor = [UIColor clearColor].CGColor;
        searchField.clearButtonMode=UITextFieldViewModeNever;

 

人已赞赏
iOS文章

UICollectionView 的使用

2019-11-16 16:34:27

iOS文章

iOS 字典和NSData之间转换

2019-11-16 23:52:43

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索