中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

IOS學習筆記(十)之UIImageView圖片視圖的基本概念和使用方法

發布時間:2020-07-04 17:44:02 來源:網絡 閱讀:639 作者:jiangqq900826 欄目:移動開發

 IOS學習筆記(十)之UIImageView圖片視圖的基本概念和使用方法

     Author:hmjiangqq

     Email:jiangqqlmj@163.com

UIImageView:

作用:專門用于顯示圖片

首先看下官方的解說:

 An p_w_picpath view object provides a view-based container for displaying either a single p_w_picpath or for animating a series of p_w_picpaths. For animating the p_w_picpaths, the UIImageView class   provides controls to set the duration and frequency of the animation. You can also start and stop the animation freely.

 When a UIImageView object displays one of its p_w_picpaths, the actual behavior is based on the properties of the p_w_picpath and the view. If either of the p_w_picpath’s leftCapWidth ortopCapHeight properties   are non-zero, then the p_w_picpath is stretched according to the values in those properties. Otherwise, the p_w_picpath is scaled, sized to fit, or positioned in the p_w_picpath view according to the contentMode property   of the view. It is recommended (but not required) that you use p_w_picpaths that are all the same size. If the p_w_picpaths are different sizes, each will be adjusted to fit separately based on that mode.

 All p_w_picpaths associated with a UIImageView object should use the same scale.   If your application uses p_w_picpaths with different scales, they may render incorrectly.

常用屬性和方法:
IOS學習筆記(十)之UIImageView圖片視圖的基本概念和使用方法

實例代碼:

//創建圖片視圖
//創建圖片視圖
UIImageView *p_w_picpathview=[[UIImageView  alloc]initWithFrame:CGRectMake(140, 100, 45, 45)];
//設置高亮
p_w_picpathview.highlighted=YES;
//設置圖片
p_w_picpathview.p_w_picpath=[UIImage p_w_picpathNamed:@"notification_icon"];
//設置高亮圖片
p_w_picpathview.highlightedImage=[UIImage p_w_picpathNamed:@"notification_icon"];
[self.window addSubview:p_w_picpathview];

- (id)initWithImage:(UIImage *)p_w_picpath;    //初始化一張圖片
- (id)initWithImage:(UIImage *)p_w_picpath highlightedImage:(UIImage *)highlightedImage NS_AVAILABLE_IOS(3_0);
//初始化 加入一張高亮圖片與本身圖片
//默認圖片
@property(nonatomic,retain) UIImage *p_w_picpath;                                                     // default is nil
//高亮圖片
@property(nonatomic,retain) UIImage *highlightedImage NS_AVAILABLE_IOS(3_0);      // default is nil
@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;               // default is NO
//設置為YES 用戶才可以進行點擊
//設置為YES 圖片高亮顯示
@property(nonatomic,getter=isHighlighted) BOOL highlighted NS_AVAILABLE_IOS(3_0); // default is NO


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

福建省| 濮阳县| 专栏| 吉首市| 高雄县| 云霄县| 娄烦县| 宜昌市| 深水埗区| 金川县| 色达县| 邯郸市| 涞源县| 庆安县| 喀喇沁旗| 甘南县| 波密县| 华亭县| 南充市| 吉水县| 万全县| 公安县| 九龙城区| 石泉县| 金山区| 维西| 林口县| 凌云县| 文成县| 庆云县| 旬阳县| 岫岩| 桦甸市| 上杭县| 惠州市| 元江| 阿拉尔市| 枣强县| 宝山区| 吉林市| 乌审旗|