iOS笔记UI--UILabel
2015-10-23 20:42
330 查看
声明:此为本人学习笔记,若有纰漏错误之处的可留言共同探讨
// 1创建UIlabel
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(self.window.frame.size.width/5, self.window.frame.size.height/2, 200, 50)]; // 标签的大小设置
// 添加子视图
[self.window addSubview:label]; // Sub 子
// 2添加文字
label.text = @"hhsdfsfdfsdfdssfsdfsdfsfsdffg";
// 3文字颜色
label.textColor =[UIColor grayColor];
// 4字体阴影
label.shadowColor = [UIColor blueColor];
// 5字体阴影偏移量
label.shadowOffset =CGSizeMake(1, 1);
// 6标签的背景颜色
label.backgroundColor=[UIColor whiteColor];
// 7字体大小
label.font = [[UIFont alloc]fontWithSize:3.2];
label.font =[UIFont systemFontOfSize:38];
// 8外框
label.layer.borderWidth=2; // layer 图层
// 9圆角
label.layer.cornerRadius = 14;
// 10文本对齐方式
[label setTextAlignment:NSTextAlignmentCenter];
// 故事板的对齐方式
// 11文本省略模式
[label setLineBreakMode:NSLineBreakByTruncatingMiddle];
// 12换行
label.numberOfLines = 3;
// 1创建UIlabel
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(self.window.frame.size.width/5, self.window.frame.size.height/2, 200, 50)]; // 标签的大小设置
// 添加子视图
[self.window addSubview:label]; // Sub 子
// 2添加文字
label.text = @"hhsdfsfdfsdfdssfsdfsdfsfsdffg";
// 3文字颜色
label.textColor =[UIColor grayColor];
// 4字体阴影
label.shadowColor = [UIColor blueColor];
// 5字体阴影偏移量
label.shadowOffset =CGSizeMake(1, 1);
// 6标签的背景颜色
label.backgroundColor=[UIColor whiteColor];
// 7字体大小
label.font = [[UIFont alloc]fontWithSize:3.2];
label.font =[UIFont systemFontOfSize:38];
// 8外框
label.layer.borderWidth=2; // layer 图层
// 9圆角
label.layer.cornerRadius = 14;
// 10文本对齐方式
[label setTextAlignment:NSTextAlignmentCenter];
// 故事板的对齐方式
// 11文本省略模式
[label setLineBreakMode:NSLineBreakByTruncatingMiddle];
// 12换行
label.numberOfLines = 3;
相关文章推荐
- poj 1141 Brackets Sequence(区间DP记录路径)
- hdoj--2767--Proving Equivalences (scc+缩点)
- hdoj--2767--Proving Equivalences (scc+缩点)
- [sicily]1388. Quicksum
- priority_queue
- java中的StringBuffer类和StringBuilder类
- 读《认知与设计:理解UI设计准则》第五章
- UC/OS和UCGUI移植札记
- request
- MSBuild 命令行参考
- MSBuild入门(续)
- 给UITabbarController 和 UINavigationController添加过场动画
- MSBuild入门
- UE3 移动设备分析
- IOS笔记UI--首次启动介绍和LaunchDemo
- 【NGUI】Input.GetTouch判断手指状态
- True(False) Positives (Negatives), 召回率和精度定义
- 关于UITextView的textViewDidChange回调没有调用的问题解决
- 关于UITextView的textViewDidChange回调没有调用的问题解决
- UE3 基本的分析及优化技术