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;

  • 相关阅读:
    老齐python-基础7(文件操作、迭代)
    老齐python-基础6(循环 if while for)
    老齐python-基础5(运算符、语句)
    老齐python-基础4(元祖、字典、集合)
    老齐python-基础3(列表)
    老齐python-基础2(字符串)
    Jupyter notebook 的安装、入门
    pycharm 激活码
    VMware无法连接 MKS:套接字连接尝试次数太多正在放弃
    Numpy基本用法简介
  • 原文地址:https://www.cnblogs.com/kfgcs/p/6704709.html
Copyright © 2011-2022 走看看