UI基础(一)
来源:互联网 发布:电力行业大数据应用 编辑:程序博客网 时间:2024/05/20 04:08
1、IBAction
1> 能保证方法可以连线
2> 相当于void
2、IBOutlet:能保证属性可以连线
3、常见错误
[setValue:forUndefinedKey:]: this class is not key value coding
错误原因:连线出问题了
4、Xcode5开始的一些建议
把用于连线的一些方法和属性声明在.m文件的类扩展中
5、frame\center\bounds
1> frame:能修改位置和尺寸
2> center:能修改位置
3> bounds:能修改尺寸(x\y一般都是0)
6、 OC语法规定:不许直接修改对象结构体属性的成员
1> CGRect tempFrame = self.head.frame.origin.y
2> tempFrame.origin.y -= 10;
3> self.head.frame = tempFrame
7、 •简易动画大致有2种方式:
Ø头尾式
[UIView beginAnimations:nil context:nil];
/** 需要执行动画的代码 **/
[UIView commitAnimations];
[UIView animateWithDuration:0.5 animations:^{
/**需要执行动画的代码 **/
}];
8、修改控件的位置和尺寸
•通过以下属性可以修改控件的位置
(angle是弧度制,并不是角度制)
view.transform = CGAffineTransformIdentity;
@property (strong, nonatomic) NSArray*images;
NSBundle*bundle = [NSBundle mainBundle];
NSString*path = [bundle pathForResource:@"imageData" ofType:@"plist"];
_images = [NSArray arrayWithContentsOfFile:path];
- (NSArray*)images
{
if (_images == nil) {
NSBundle*bundle = [NSBundle mainBundle];
NSString*path = [bundle pathForResource:@"imageData" ofType:@"plist"];
_images = [NSArray arrayWithContentsOfFile:path];
}
return _images;
}
•方式一:有缓存(图片所占用的内存会一直停留在程序中),适合图片较少的时候使用,当你把图片放在Images.xcassets 就只能通过imageNamed加载
// 清空图片数组animationImages的时间为动画执行完毕后0.1s
CGFloat delay = self.imageView.animationDuration + 0.1;
// 让self.imageView延迟 delay秒 执行setAnimationImages:方法来清空图片数组animationImages
[self.imageView performSelector:@selector(setAnimationImages:) withObject:nil afterDelay:delay];
相当于调用了animationImages的setter方法:self.imageView.animationImages = nil
- UI基础(一)
- UI基础(一)
- UI基础控件(一)
- UI 基础控件(一)-----------UILabel
- 【Android基础】(7)UI控件(一)
- UI基础控件一
- iOS 8人机界面指南(一):UI设计基础
- 黑马程序员-----随堂笔记之UI基础(一)
- iOS 8人机界面指南(一):UI设计基础
- Apple Watch人机交互指南--UI设计基础(一)
- iOS 8人机界面指南(一):UI设计基础
- 【Android UI】ListView系列一(基础篇)
- iOS UI学习笔记(一)UIView基础
- Unity UI(一):UI组件概览
- [ISUX转译]iOS 8人机界面指南(一):UI设计基础
- UI基础第十四弹:使用UItableview完成一个简单的QQ好友列表(一)
- UI基础第十四弹:使用UItableview完成一个简单的QQ好友列表(一)
- [ISUX转译]iOS 8人机界面指南(一):UI设计基础
- Iterator模式(C++迭代器模式)
- ExtJS学习之路第一步:对比jQuery,认识ExtJS
- nvocationHandler中invoke()方法的调用问题
- ExtJS学习之路第二步:Ext.Component 和 Ext.dom.Element 的区别
- Linux-0.11内核源码分析系列:进程调度sleep_on()函数分析
- UI基础(一)
- ExtJS学习之路第三步:理解引擎之下,ExtJS4中的类
- 可以让用户自定义动态链接数据库
- Atitit.mysql oracle with as模式临时表模式 CTE 语句的使用,减少子查询的结构性 mssql sql server..
- 【Linux】Linux中正则表达式
- OC:协议与代理设计
- Core Animation
- C语言作业//信号报告(分支)
- ExtJS学习之路第四步:看源码,实战MessageBox