IOS UI 手写UILable
来源:互联网 发布:阿拉伯血钻野燕麦知乎 编辑:程序博客网 时间:2024/05/01 01:56
[super viewDidLoad]; // Do any additional setup after loading the view. //UILable 初始化方法 UILabel *TestLable = [[UILabel alloc]init]; //设置Frame坐标及大小 CGFloat TestLableX = 0; CGFloat TestLableY = 70; CGFloat TestLableW = self.view.bounds.size.width; CGFloat TestLableH = 20; //设定按钮的显示位置 CGRect AA = CGRectMake(TestLableX, TestLableY, TestLableW, TestLableH); TestLable.frame = AA; //设定背景色 TestLable.backgroundColor = [UIColor redColor]; //设定文字 内容 字体字号 颜色 TestLable.text = @"按钮文字"; TestLable.font = [UIFont fontWithName:@"Helvetica-Bold" size:20]; TestLable.textColor = [UIColor whiteColor]; //设置对其方式 //NSTextAlignmentCenter 居中对其 //NSTextAlignmentLeft 向左对其 //NSTextAlignmentRight 向右对其 //TestLable.textAlignment = NSTextAlignmentCenter; //设置阴影 //设置阴影色彩和透明度 TestLable.shadowColor = [UIColor colorWithWhite:0.1f alpha:0.8f]; //设置阴影的纵横向的偏移量 TestLable.shadowOffset = CGSizeMake(0, -1); //设置换行 TestLable.lineBreakMode = NSLineBreakByWordWrapping; //指定文本行数 0无限制 TestLable.numberOfLines = 0; //显示进UIView [self.view addSubview:TestLable];
0 0
- IOS UI 手写UILable
- iOS开发UI篇 -- UILable
- IOS UI 手写 UIButton
- IOS UI 手写 UIImageView
- iOS开发UI技巧篇 -- UILable
- iOS UI学习笔记(三)UIlable
- UI-UILable
- IOS--UILable
- UILable常见用法 - iOS - UI基础知识总结3
- UI之UILable详解
- UI-2-IIMageView、UILable
- UI-IImageView、UILable作业
- 代码手写UI,xib和StoryBoard间的博弈(IOS)
- IOS中UI开发之:xib/storyboard or 手写代码
- IOS开发之UILable
- iOS UIlable使用详情
- iOS开发 -- UILable详解
- iOS开发 ----- UILable
- Inventor API: 简单聊聊ReplaceReference , FileSaveAs, OnFileResolution
- iOS-OC-NSDictionary和NSMutableDictionary用法大全详细说明
- 7、JSONArray的应用
- 回到顶部功能实现
- 二叉树的前序遍历
- IOS UI 手写UILable
- SharedPreferences详解
- Problem P
- ubuntu 上安装opencv以及测试
- jquery-zclip插件
- DataBinding学习(五)
- BW ZCHANGE_PACKAGE
- iOS-OC-NSArray用法大全详细说明
- EventBus-通信框架