UILabel,UITextField,UIButton,UIimageView
来源:互联网 发布:云桌面软件 编辑:程序博客网 时间:2024/05/17 09:12
一、UILabel
UILabel:标签视图,继承与UIView,比UIView多的功能是可以显示文字。
UILabel属性设置:
二、UITextField
UITextField(输入框):是控制文本输入和显示的控件。UITextField和UILabel相比,UILabel主要用于文字显示,不能编辑,UITextField允许用户编辑文字(输入)。
UITextField文本显示属性:
UITextField输入控制属性:
UITextField外观控制属性:
UITextField常用代理方法:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField; - (void)textFieldDidBeginEditing:(UITextField *)textField; - (BOOL)textFieldShouldEndEditing:(UITextField *)textField; - (void)textFieldDidEndEditing:(UITextField *)textField; - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; - (BOOL)textFieldShouldClear:(UITextField *)textField;- (BOOL)textFieldShouldReturn:(UITextField *)textField;
三、UIButton
UIButton(按钮):是响应用户点击的控件,侧重于处理用户交互事件。
UIButton外观控制属性:
UIButton添加事件:
四、UIImageView
UIImageView:是iOS中用于显示图片的类,相当于画框;UIImage,非视图,只有通过UIImageView才能显示,相当于照片。
创建image:
//创建image方式1, 该方式会把图片存入内存.UIImage *image = [UIImage imageNamed:@"1.jpg"];//创建image方式2 不会存入内存,直接从包内读取.UIImage *image2 = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"1" ofType:@"jpg"]];
UIImageView的动态图示例:
UIImageView *imageV = [[UIImageView alloc] init];NSMutableArray *imageArr = [@[] mutableCopy];for (int i = 0; i <= 21; i++){ UIImage *image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%d", i] ofType:@"png"]]; [imageArr addObject:image];}//设置一组动态图片imageV.animationImages = imageArr;//整个动画的执行事件.imageV.animationDuration = 0.5;//整个动画需要循环多少次imageV.animationRepeatCount = 10000;//开始动画[imageV startAnimating];//结束动画//[imageV stopAnimating];
阅读全文
0 0
- UIButton,UIImageView,UILabel,UITextField
- UILabel,UITextField,UIButton,UIimageView
- UILabel、UITextField、UIButton、UIImageView控件
- UIView UILabel UITextField UIButton UIImageView 常用属性
- iOSDay21之UILabel, UITextField, UIButton, UIImageView
- UI-基本控件( UILabel UITextField UIImageView UIButton)
- 基础控件之UILabel、UIButton、UITextField、UIAlertView、 UIImageView
- UILabel, UITextField, UIImageView
- UITextField、UILabel、UIButton
- UILabel, UITextField, UIButton
- UILabel,UITextField,UIButton
- UIView UILabel UITextField UIButton
- UILabel、UITextField、UIButton
- UIButton, UILabel, UITextField
- iOS个人整理06-第一周小结,常用控件UIView,UILabel,UIImageView,UIButton,UITextField
- IOS开发UI系列之常用控件 UILabel, UITextField, UIButton, UIImageView等常用属性与方法
- iOS基础——UI控件之UIView、UITextField、UILabel、UIColor、UIButton、UIImageView
- Swift - UIView,UILabel,UIButton,UIImageView
- BZOJ2863 愤怒的元首
- 第一篇--python selenium 环境配置
- 6、ICMP:Internet控制报文协议
- 文件浏览器_数码相框项目总结 (上)
- HDU1792(公式)
- UILabel,UITextField,UIButton,UIimageView
- [DFS] HOJ 1797 Red and Black
- Eigen 输出格式
- Linux 的字符串截取很有用:有八种方法。
- 汇编中调用printf
- Python---4.文件读写
- 百家讲坛 大风歌
- 设计模式2-工厂模式
- fork没有返回2次,它只返回1次