UiImageView控件属性

UIImageView控件属性:

1.Image 设置图片,默认显示

 UIImageView *_imageView = [[UIImageView alloc]init];

_imageView.image = [UIImage imageNamed:@"me.png"];

2.highlightedImage 设置高亮状态下显示的图片

_imageView.highlightedImage = [UIImage imageNamed:@"other.png"];

3.animationImages 设置序列帧动画的图片数组

 [_imageView setAnimationImages:[NSArray array]];

4.highlightedAnimationImages 设置高亮状态下序列帧动画的图片数组

[_imageView setHighlightedAnimationImages:[NSArray array]];

5.animationDuration 设置序列帧动画播放的时常

[_imageView setAnimationDuration:0.3f];

6.animationRepeatCount 设置序列帧动画播放的次数

[_imageView setAnimationRepeatCount:2];

7.userInteractionEnabled 设置是否允许用户交互,默认不允许用户交互

[_imageView setUserInteractionEnabled:YES];

8.highlighted 设置是否为高亮状态,默认为普通状态

_imageView.highlightedImage = [UIImage imageNamed:@"other.png"];

[_imageView setHighlighted:YES];

注意的是在highlighted状态下设置的图片与序列帧动画要显示,必须同时设置UIImageView的状态为highlighted。
时间: 2024-12-27 00:21:29

UiImageView控件属性的相关文章

从零开始学习ios(UIImageView)控件及其属性

//创建图片视图时就设定Frame的属性和大小 UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(60, 20, 80, 100)]; [img setImage:[UIImage imageNamed:@"mtxx6"]]; /* 创建图片视图的另外四种方法 type img{ UIImageView *img1 = [[UIImageView alloc]init]; UIImageView *img2

UITextField控件属性

UITextField控件属性: enablesReturnKeyAutomatically 默认为No,如果设置为Yes,文本框中没有输入任何字符的话,右下角的返回按钮是disabled的. 1.borderStyle 设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITextBo

Quartz2D(自定义UIImageView控件)

Quartz2D(自定义UIImageView控件) 一.实现思路 Quartz2D最大的用途在于自定义View(自定义UI控件),当系统的View不能满足我们使用需求的时候,自定义View. 使用Quartz2D自定义View,可以从模仿系统的ImageView的使用开始. 需求驱动开发:模仿系统的imageview的使用过程 1.创建 2.设置图片 3.设置frame 4.把创建的自定义的view添加到界面上(在自定义的View中,需要一个image属性接收image图片参数->5). 5.

iOS--Quartz2D使用(自定义UIImageView控件、绘制基本图形)

自定义UIImageView控件 一.实现思路 Quartz2D最大的用途在于自定义View(自定义UI控件),当系统的View不能满足我们使用需求的时候,自定义View. 使用Quartz2D自定义View,可以从模仿系统的ImageView的使用开始. 需求驱动开发:模仿系统的imageview的使用过程 1.创建 2.设置图片 3.设置frame 4.把创建的自定义的view添加到界面上(在自定义的View中,需要一个image属性接收image图片参数->5). 5.添加一个image属

控件属性设置

控件属性设置 XIB中设置UILabel文字居中 选中位于视图下方的Label对象,单击检视面板选择条中的Attributes Inspector图标,打开属性面板.在属性面板中找到标题为Alignment的分段控件(seg-mented control).选择中间的那个选项(居中对齐),如图所示. 改变按钮的背景颜色 在属性检视面板中向下滚动,会看到View标题下方的属性.在Background标签右侧,点击颜色面板(白色方块,上面有一条红色的斜线)可以打开颜色拾取器.

第三篇:属性_第一节:控件属性与属性的持久化

一.控件属性 首先,属性是各种.net语言的基本语法.而我们常说的控件属性是指控件类中用public修饰的属性. 见Lable的Text属性: [Bindable(true), DefaultValue(""), Localizable(true), PersistenceMode(PersistenceMode.InnerDefaultProperty), WebCategory("Appearance"), WebSysDescription("Lab

UIView控件属性

UIView控件属性: 1.alpha 设置视图的透明度.默认为1. // 完全透明 view.alpha = 0; // 不透明 view.alpha = 1; 2.clipsToBounds // 默认是NO,当设置为yes时,超出当前视图的尺寸的内容和子视图不会显示. view.clipsToBounds = YES; 3.hidden // 默认是NO,当设置为yes,视图就看不见了. view.hidden = YES; 4.userInteractionEnabled // 默认为Y

UITextView控件属性

UITextView控件属性: 1.text: 设置textView中文本 _textView.text = @"Now is the time for all good developers to come to serve their country.\n\nNow is the time for all good developers to come to serve their country."; // 设置它显示的内容 2.font:设置textView中文字的字体 _te

UISwitch控件属性

UISwitch控件属性: 1. onTintColor 处于on时switch 的颜色 switchImage.onTintColor = [UIColor grayColor]; 2.tintColor 处于off时switch 的颜色 switchImage.tintColor = [UIColor greenColor]; 3.onImage 设置on 的图标 switchImage.onImage = [UIImage imageNamed:@"1.png"]; 4. off