#import "XZCTextField.h"

@implementation XZCTextField

////控制清除按钮的位置
//-(CGRect)clearButtonRectForBounds:(CGRect)bounds
//{
//    return CGRectMake(bounds.origin.x + bounds.size.width - 50, bounds.origin.y + bounds.size.height -20, 16, 16);
//}

//控制placeHolder的位置,左右缩20
-(CGRect)placeholderRectForBounds:(CGRect)bounds
{
   
    //return CGRectInset(bounds, 20, 0);
    CGRect inset = CGRectMake(bounds.origin.x+10, bounds.origin.y, bounds.size.width -10, bounds.size.height);//更好理解些
    return inset;
}
//控制显示文本的位置
-(CGRect)textRectForBounds:(CGRect)bounds
{
    //return CGRectInset(bounds, 50, 0);
    CGRect inset = CGRectMake(bounds.origin.x+10, bounds.origin.y, bounds.size.width -30, bounds.size.height);//更好理解些
   
    return inset;
   
}
//控制编辑文本的位置
-(CGRect)editingRectForBounds:(CGRect)bounds
{
    //return CGRectInset( bounds, 10 , 0 );
   
    CGRect inset = CGRectMake(bounds.origin.x +10, bounds.origin.y, bounds.size.width -30, bounds.size.height);
    return inset;
}
////控制左视图位置
//- (CGRect)leftViewRectForBounds:(CGRect)bounds
//{
//    CGRect inset = CGRectMake(bounds.origin.x +10, bounds.origin.y, bounds.size.width-250, bounds.size.height);
//    return inset;
//    //return CGRectInset(bounds,50,0);
//}

////控制placeHolder的颜色、字体
//- (void)drawPlaceholderInRect:(CGRect)rect
//{
//    //CGContextRef context = UIGraphicsGetCurrentContext();
//    //CGContextSetFillColorWithColor(context, [UIColor yellowColor].CGColor);
//    [[UIColor orangeColor] setFill];
//   
//    [[self placeholder] drawInRect:rectwithFont:[UIFont systemFontOfSize:20]];
//}

@end

TextField 的文字间距的更多相关文章

  1. TextField的文字距左边框的距离偏移

    默认情况下,当向textField输入文字时,文字会紧贴在textField左边框上. 我们可以通过设置textField的leftView,设置一个只有宽度的leftView. 这样还不够,因为默认 ...

  2. 怎样使用CSS设置文字与文字间距距离?

    [文字与文字间距距离,字与字距离间距CSS如何设置?]如果你也遇到W3Cschool用户唐婷大小姐类似的问题不妨也到W3Cschool编程问答进行提问. 对于使用CSS解决字间距的方法W3Cschoo ...

  3. 段落排版--中文字间距、字母间距(letter-spacing, word-spacing)

    中文字间隔.字母间隔设置: 如果想在网页排版中设置文字间隔或者字母间隔就可以使用    letter-spacing 来实现,如下面代码: h1{ letter-spacing:50px; } ... ...

  4. 限制textfield的文字长度

    -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementSt ...

  5. css 文字间距

    letter-spacing :  字与字之间的距离 text-indent : 行的抬头间距 line-height : 行高度

  6. iPhone UIButton图标与文字间距设置【转】

    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(50, 50, 150, 50)]; [button setTitle:@& ...

  7. WPF文字间距

    代码: <ItemsControl ItemsSource="{Binding Info}" FontFamily="微软雅黑" FontSize=&qu ...

  8. 设置textfield 文字左边距

    默认情况下,当向textField输入文字时,文字会紧贴在textField左边框上.我们可以通过设置textField的leftView,设置一个只有宽度的leftView.这样还不够,因为默认le ...

  9. WPF 竖排文字

    ---恢复内容开始--- 想做一个WPF 文字竖排 类似上图.用在TabItem的header上面. <TextBlock FontSize="30" Text=" ...

随机推荐

  1. JSON.parse()的正确用法

    昨天晚上在项目中使用JSON.parse()来将字符串格式的数据转换成json,结果悲剧了,总感觉方法没有用错,可是就是报错!想了好久,最后发现原来是json字符串格式不标准! 如:var a = “ ...

  2. unity, readOnly varible

    参考:http://answers.unity3d.com/questions/489942/how-to-make-a-readonly-property-in-inspector.html

  3. POJO类中的任何布尔类型的变量,都不要加is

    POJO类中的任何布尔类型的变量,都不要加is,否则部分框架解析会引起序列化错误. 定义为基本数据类型boolean isSuccess:的属性,它的方法也是isSuccess(),HSF框架在反向解 ...

  4. MSSQL反旋转的例子

    with cte as ( select 'A' as tag , as num_1 , as num_2 , as num_3 , as num_4 ,null as num_5 union sel ...

  5. nginx,php相关

    nginx安装 http://www.nginx.cn/install php安装 https://segmentfault.com/a/1190000004123048#articleHeader5 ...

  6. Provisional, Temporary 和Interim 的区别

    1 Provisional  adj. 临时的.暂时的.暂定的:n. 临时邮票 强调在一定时期内暂时的.双方同意的但还不是最终确定的决定或者条约等. Such as例如: Provisional go ...

  7. 初学RabbitMQ

    一.RabbitMQ中的一些概念 (1)Connection(连接) 与RabbitMQ建立连接,由ConnectionFactory创建每个Connection至于一个物理server进行连接,此链 ...

  8. oracle直通车6关于rman备份恢复数据文件,以及创建分区表的实验

    1.创建一张表,在表上创建一个索引,分别查询表,索引各自分配了多少个extents,多少个数据块以及总共占用空间的大小(bytes). 答:创建一张表t,为字段object_id创建索引t_objec ...

  9. div 居中

    Found another solution: Just add position: relative; top: 50%; transform: translateY(-50%); to the i ...

  10. KVO/KVC 实现机理分析

    来源:http://blog.csdn.net/dqjyong/article/details/7672865 Objective-C里面的Key-Value Observing (KVO)机制,非常 ...