UIlabel多行文字自动换行 (自动折行)
2015-11-18 17:59
477 查看
UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(10, 100, 300, 180)]; UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10, 100, 300, 150)]; label.text = @"Hello world! Hello world!Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!Hello world! Hello world! Hello world! Hello world! Hello world! Helloworld!"; //背景颜色为红色 label.backgroundColor = [UIColor redColor]; //设置字体颜色为白色 label.textColor = [UIColor whiteColor]; //文字居中显示 label.textAlignment = UITextAlignmentCenter; //自动折行设置 label.lineBreakMode = UILineBreakModeWordWrap; label.numberOfLines = 0;
相关文章推荐
- UIAlertController的使用
- 解决github push错误The requested URL returned error: 403 Forbidden while accessing
- UITouch 与 手势识别器
- FreeMarkerConfigurer使用TemplateDirectiveModel时获取request、session
- QOS
- UITableView样式的自定义
- ios UIButton点击事件(@selector)注意事项
- - (void)layoutSublayersOfLayer:(CALayer *)layer
- [转]Android UI:看看Google官方自定义带旋转动画的ImageView-----RotateImageView怎么写(附 图片淡入淡出效果)
- UICopyLable
- UICollectionView UITableView registerNib和registerClass的回调
- String Stringbuffer Stringbuilder
- 06 OSPF路由器协议
- UE4 Console Commands List
- 04 RIP路由协议
- 文章标题
- IOS控件学习:UILabel常用属性与用法
- 获取请求信息——Request对象的方法
- NSDate和UIImage 数据相互转化_数据库中只能存二进制数据
- 近期UI设计经验回顾