UILabel详解
// ----------------------UILabel---------------------------
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
label.text = @"i'm text ddddddd";
label.textColor = [UIColor redColor];
label.font = [UIFont systemFontOfSize:20];
// label.font = [UIFont boldSystemFontOfSize:20];
label.backgroundColor = [UIColor grayColor];
// label.backgroundColor = [UIColor clearColor]; // 清除背景色
// 支持行数
label.numberOfLines = 1;
// 文字对齐方式 :在iOS中默认的UILabel中的文字在竖直方向上只能居中对齐
label.textAlignment = kCTLeftTextAlignment;
// 文字过长时截断方式
label.lineBreakMode = NSLineBreakByTruncatingTail;
// 设置高亮
label.highlighted = YES;
label.highlightedTextColor = [UIColor orangeColor];
// 文字是否可变, 默认可变
label.enabled = NO;
UILabel详解的更多相关文章
- iOS UILabel详解
1.创建 CGRect rect = CGRectMake(100, 200, 50, 50); UILabel *label = [[UILabel alloc] initWithFrame:rec ...
- UILabel 详解
转自:http://blog.csdn.net/zhaopenghhhhhh/article/details/16331041 ·UILable是iPhone界面最基本的控件,主要用来显示文本信息.· ...
- IOS开发学习笔记(1)-----UILabel 详解
1. [代码][C/C++]代码 //创建uilabelUILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 40, ...
- 详解UILabel的adjustsFontSizeToFitWidth值
详解UILabel的adjustsFontSizeToFitWidth值 UILabel有一个属性值,叫adjustsFontSizeToFitWidth,看着名字就知道,他是用来让文字自动适应UIL ...
- iPhone应用开发 UITableView学习点滴详解
iPhone应用开发 UITableView学习点滴详解是本文要介绍的内容,内容不多,主要是以代码实现UITableView的学习点滴,我们来看内容. -.建立 UITableView DataTab ...
- UI第六节——UINavigationController 详解
1. UINavigationController 是一个容器类.里面盛放的是UIViewController. 容器的意思是,如果你不放入UIViewController,里面就是空的,什么也没有. ...
- 自动布局之autoresizingMask使用详解(Storyboard&Code)
自动布局之autoresizingMask使用详解(Storyboard&Code) http://www.cocoachina.com/ios/20141216/10652.html 必须禁 ...
- UITableView 详解 ()
(原本取至D了个L微信公众号) UITableView 详解 一.建立 UITableView DataTable = [[UITableView alloc] initWithFrame:CGRec ...
- UINavigationController使用详解
UINavigationController使用详解 有一阵子没有写随笔,感觉有点儿手生.一个多月以后终于又一次坐下来静下心写随笔,记录自己的学习笔记,也希望能够帮到大家. 废话少说回到正题,UINa ...
随机推荐
- Configuration.ConfigurationSettings.AppSettings已过时
1.在项目中引用System.Configuration.dll,在需要的页面加上using System.Configuration; 2.把ConfigurationSettings.AppSet ...
- Rails--%w用法[转]
%Q 用于替代双引号的字符串. 当你需要在字符串里放入很多引号时候, 可以直接用下面方法而不需要在引号前逐个添加反斜杠 (\") >> %Q(Joe said: "Fr ...
- Bootstrap页面布局12 - BS表单元素的排版
首先看看这行代码: <label for='account'>帐 号</label> <input id='account' name='account' type='t ...
- Laravel timestamps 设置为unix时间戳
Laravel timestamps 设置为unix时间戳 class BaseModel extends Eloquent { /** * 默认使用时间戳戳功能 * * @var bool */ p ...
- wflag
http://stackoverflow.com/questions/41312622/how-to-echo-an-alert-in-php-a-string-some-confusion-with ...
- hardware control language
Computer Systems A Programmer's Perspective Second Edition We then provide some background on digita ...
- [转]正则表达式相关:C# 抓取网页类(获取网页中所有信息)
using System; using System.Data; using System.Configuration; using System.Net; using System.IO; usin ...
- qt 4.6.2 与visual studio 2005 集成(编译方法,以及中间遇到的问题)
不知不觉在蒂森差不多半个月了,哈哈,时间过得很快,过得很充实,近来研究QT,首先嘛,肯定要学会安装了,这最基础的不会更不用说下面的啦.闲话少说,进正题,基本的安装步骤网上多的是,但参考一个大多数情况是 ...
- android获取设备全部信息
private static final String FILE_MEMORY = "/proc/meminfo"; private static final String FIL ...
- Aptana快捷键(方便查询)
窗口类:Ctrl+ Shift +L 调出快捷键提示Ctrl+ W 关闭当前标签窗口Ctrl+ Shift + W 关闭当前标签窗口Ctrl+ F6 (或者是Aptana的Ctrl+Tab )下一个编 ...