码迷,mamicode.com
首页 > 其他好文 > 详细

textField常用的属性

时间:2016-09-19 08:56:37      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:

 UITextField *textF = [[UITextField alloc]initWithFrame:CGRectMake(0, kFitH(100), kScreenWidth, kFitH(60))];

    

    textF.backgroundColor = [UIColor whiteColor];

    

    textF.placeholder = @" 输入手机号码";

    textF.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;

    

//设置placeholder的字体

[textF setValue:[UIFont fontWithName:kFontPingFangMedium size:kFitFontSize(32)] forKeyPath:@"_placeholderLabel.font"];

//设置文字的字体   

textF.font = [UIFont fontWithName:kFontPingFangMedium size:kFitFontSize(32)];

//设置光标的颜色    

textF.tintColor = [UIColor grayColor];

//设置光标左移    

UIView *leftVie = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 10, 0)];    

textF.leftView = leftVie;

//设置左边view的显示方式

 textF.leftViewMode = UITextFieldViewModeAlways;

 

textField常用的属性

标签:

原文地址:http://www.cnblogs.com/chaoyueME/p/5883782.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!