zoukankan      html  css  js  c++  java
  • 关于textField输入光标颜色及cleanButton大小和颜色的设置

    一.光标颜色设置:

    1.全局设置

    [[UITextField appearance] setTintColor:[UIColor blackColor]];  

    2.单个修改(在xib中修改tintColor注意可能不好用)

    self.textField.tintColor = [UIColor whiteColor];

    二.右侧的clean按钮:

    UIButton *clean = [self.textField valueForKey:@"_clearButton"]; //key是固定的

    [clean setImage:[UIImage imageNamed:@"imagename"] forState:UIControlStateNormal];

    [clean setImage:[UIImage imageNamed:@"imagename"] forState:UIControlStateHighlighted];

    *颜色设置     颜色设置可以通过image设置,当然UIImage imageWithColor应该也可以。

    *大小设置   大小貌似不可以更改,但是可以通过设置image的四边留白来控制大小,留白越大,按钮看起来越小。

  • 相关阅读:
    python 中的[::-1]
    python 闭包
    elastic
    文件上传进度条修改
    python decorator的理解
    同方爬虫--面试题
    js typeof
    浅谈软件项目实施
    数独·唯一性技巧(Uniqueness)-1
    数独二
  • 原文地址:https://www.cnblogs.com/lxllanou/p/8513872.html
Copyright © 2011-2022 走看看