zoukankan      html  css  js  c++  java
  • 获取UISearchBar上的UITextField

    获取UISearchBar上的UITextField并对其操作:

    1     UITextField *searchField = [_searchBar valueForKey:@"_searchField"];
    //获取只需要上面一句话
    2 searchField.tag = 100; 3 searchField.textColor = fontBlackColor; 4 searchField.backgroundColor = Bg_Grey; 5 [searchField setLeftViewMode:UITextFieldViewModeNever]; 6 [searchField setRightViewMode:UITextFieldViewModeNever]; 7 [searchField setValue:fontGreyColor forKeyPath:@"_placeholderLabel.textColor"]; 8 [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;

  • 相关阅读:
    CCF2014123集合竞价(C语言版)
    CCF2016092火车购票
    CCF2013123最大的矩形(C语言版)
    CCF2015122消除类游戏(C语言版)
    CCF2014032窗口(C语言)
    CCF2016093炉石传说(C语言版)
    go module 获取码云私有仓库代码
    centos7 编译安装 redis-6.0.5
    goland2019.2破解方法
    mac下protobuf配置记录
  • 原文地址:https://www.cnblogs.com/kfgcs/p/6704709.html
Copyright © 2011-2022 走看看