获取searchbar里的textField

来源:互联网 发布:沈阳关键词优化排名 编辑:程序博客网 时间:2024/06/06 03:28

-(void) layoutSubviews{

        [super layoutSubviews];

        UIView *searchTextField = nil;

        // 经测试, 需要设置barTintColor后, 才能拿到UISearchBarTextField对象

        self.barTintColor = [UIColor whiteColor];

        searchTextField = [[[self.subviews firstObject] subviews] lastObject];

        if(reSize){

            searchTextField.frame = newFrame;

        }

}


0 0
原创粉丝点击