zoukankan      html  css  js  c++  java
  • UITextField的placeholder文字的位置,颜色等的自定义设置

    //控制placeHolder的位置,左右缩20

    -(CGRect)placeholderRectForBounds:(CGRect)bounds

    {

       CGRect inset = CGRectMake(bounds.origin.x+100, bounds.origin.y, bounds.size.width -10, bounds.size.height);//更好理解些

       return inset;

    }

    //控制显示文本的位置

    -(CGRect)textRectForBounds:(CGRect)bounds

    {

        CGRect inset = CGRectMake(bounds.origin.x+190, bounds.origin.y, bounds.size.width -10, bounds.size.height);//更好理解些

        

        return inset;

    }

    //控制编辑文本的位置

    -(CGRect)editingRectForBounds:(CGRect)bounds

    {

       CGRect inset = CGRectMake(bounds.origin.x +10, bounds.origin.y, bounds.size.width -10, bounds.size.height);

       return inset;

    }

    //控制placeHolder的颜色、字体

    - (void)drawPlaceholderInRect:(CGRect)rect

    {

         [[UIColor orangeColor] setFill];

        [[selfplaceholder] drawInRect:rectwithFont:[UIFontsystemFontOfSize:20]];

    }

  • 相关阅读:
    谷歌翻译python接口
    SRILM的安装方法
    语言模型srilm基本用法
    SRILM语言模型格式解读
    矩阵理解
    python生成器 协程
    python Queue模块使用
    scrapy 学习笔记2
    scrapy 学习笔记1
    xpath语法规则
  • 原文地址:https://www.cnblogs.com/lcl15/p/5433232.html
Copyright © 2011-2022 走看看