iOS UI Label控件
来源:互联网 发布:佳能手机打印软件 编辑:程序博客网 时间:2024/05/01 17:00
text: label 显示的文字;
font : text字体,值不可以是nil。
textColor : text 颜色;
textAlignment: text的对齐方式(左对齐,居中对齐,右对齐) (0左 1中 2右)。
enable: text是否可变 BOOL值(YES,NO);
shadowColor : text的 阴影,包含阴影颜色;
UILabel * redView1 = [[UILabel alloc] initWithFrame:CGRectMake(50, 175, 90, 25)]; UILabel * redView2 = [[UILabel alloc] initWithFrame:CGRectMake(0, 50, 90, 50)]; UIView * blueView1 = [[UIView alloc] initWithFrame:CGRectMake(175, 175, 150, 25)]; UIView * blueView2 = [[UIView alloc] initWithFrame:CGRectMake(0, 50, 150, 25)]; UIView * greenView1 = [[UIView alloc] initWithFrame:CGRectMake(50, 275, 70, 25)]; UIView * greenView2 = [[UIView alloc] initWithFrame:CGRectMake(103, 0, 70, 25)]; UIView * greenView3 = [[UIView alloc] initWithFrame:CGRectMake(103, 0, 70, 25)]; [redView1 setText:@"用户名:"];// 添加文字 redView1.textAlignment = NSTextAlignmentCenter; //居中对齐 redView1.textColor = [UIColor whiteColor]; //设置文字颜色; //redView1.font = [UIFont fontWithName:@"行楷-Bold" size:16]; 设置文字字体和大小 redView1.font = [UIFont boldSystemFontOfSize:16]; //加粗 字号 [redView2 setText:@"这是我的第二次iOS UI课程,学的是label控件,用法与View基本相同" ]; [redView1 setShadowColor:[UIColor blackColor]];//set 文字阴影 阴影颜色 redView1.shadowOffset = CGSizeMake(2, 0);// 阴影向X轴正方向偏移2,向y偏移0 redView2.textColor = [UIColor whiteColor]; redView2.font = [UIFont systemFontOfSize:16]; redView2.numberOfLines = 2; //显示2行,如果高度不能容纳2行,没显示的以...代替 redView2.textAlignment = NSTextAlignmentCenter;
0 0
- IOS-UI控件-label
- iOS UI Label控件
- IOS UI控件 label基础属性使用
- ui控件--label
- IOS UI -label总结
- IOS开发UI-------label
- iOS 控件之Label
- iOS UI - 用循环批量创建Label
- IOS UI Label的一些用法
- IOS UI 01 课堂笔记 -label
- IOS自定义UI控件
- IOS UI基础控件
- iOS 基本UI控件
- IOS UI控件-UIScrollView
- IOS UI控件 - UIImageView
- IOS UI控件 - UIButton
- ios UI控件关联
- iOS UI常用控件
- Lua学习一
- 【CUDA并行编程之六】KNN算法的并行实现
- YTU-OJ-虚基类练习:动物
- 浅析在网页设计中如何让按钮激发用户点击欲望
- YTU-OJ-熟悉题型——填空题(删除线性表节点)
- iOS UI Label控件
- 打印样式
- YTU-OJ-C++时间类的运算符重载
- 求质数
- Intent.FLAG_ACTIVITY_CLEAR_TOP 的使用注意
- ubuntu 12.04 编译LTIB错误 Died at ./ltib line 1392.
- 【CUDA并行编程之七】数组元素之和
- [转]Rest架构成熟度
- quartz cron表达式在线生成