一、效果展示 1. 启动界面只有一个按钮 2. 点击按钮,显示文本信息 二、 分析 1. 两个控件UILabel && UIButton 2. 点击按钮触动方法设置文本信息 三、 实现 1. 不加载Main.storyboard 2. APPDelegate.m 3. ViewController. ...
分类:
其他好文 时间:
2016-09-02 00:46:48
阅读次数:
206
原文链接: UILabel设置圆角无效 简书主页:http://www.jianshu.com/users/37f2920f6848 Github主页:https://github.com/MajorLMJ iOS开发者公会-技术1群 QQ群号:87440292 iOS开发者公会-技术2群 QQ群号 ...
分类:
其他好文 时间:
2016-09-01 16:01:53
阅读次数:
179
1 理解自身内容尺寸约束与抗压抗拉 自身内容尺寸约束:一般来说,要确定一个视图的精确位置,至少需要4个布局约束(以确定水平位置x、垂直位置y、宽度w和高度h)。但是,某些用来展现内容的用户控件,例如文本控件UILabel、按钮UIButton、图片视图UIImageView等,它们具有自身内容尺寸( ...
分类:
其他好文 时间:
2016-08-31 11:48:21
阅读次数:
271
你真的了解UIbutton,UILabel吗? 一:首先查看一下关于UIButton的定义 @class UIImage, UIFont, UIColor, UIImageView, UILabel; //设置UIButton的样式 typedef NS_ENUM(NSInteger, UIButt ...
分类:
其他好文 时间:
2016-08-30 09:27:20
阅读次数:
150
例如:CGFloat width1 = [UILabel getWidthWithTitle:strzhengcahngshu font:cell.zhengchangLabel.font]; cell.zhengchangshuLabel.frame = CGRectMake(46, 60, wi ...
分类:
其他好文 时间:
2016-08-27 12:41:41
阅读次数:
172
一:首先查看一下关于UIButton的定义 UIButton是继承于UIControl,并且也遵循NSCoding的协议; 知识点1:关于UIControlState的Enum值 知识点2:contentHorizontalAlignment;可以设置UIButton文字的对齐方式,contentH ...
分类:
其他好文 时间:
2016-08-24 17:07:46
阅读次数:
192
跟通知一样也是两个控制器,然后代码创建控件直接上代码 #import "ViewController.h" #import "TwoViewController.h" @interface ViewController () { UIButton *_nextBtn; UILabel *_showL ...
分类:
移动开发 时间:
2016-08-23 23:28:54
阅读次数:
229
/* Accessing the Text Attributes text property font property textColor property textAlignment property lineBreakMode property enabled property Sizing ...
分类:
其他好文 时间:
2016-08-23 14:34:31
阅读次数:
234
直接创建两个控制器,点击跳转第二个界面,然后点击按钮进行传值 #import "ViewController.h" #import "TWOOViewController.h" @interface ViewController () @property(nonatomic,weak)UILabel ...
分类:
移动开发 时间:
2016-08-23 01:10:38
阅读次数:
217