91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

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

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

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

泾川县| 肃南| 临潭县| 镇沅| 尼勒克县| 霞浦县| 南川市| 西林县| 桐城市| 怀柔区| 义马市| 曲周县| 深圳市| 民丰县| 三明市| 黔江区| 景宁| 河间市| 清流县| 博兴县| 南宁市| 新晃| 合作市| 右玉县| 包头市| 庐江县| 鹤壁市| 太和县| 江阴市| 棋牌| 台东市| 贵定县| 尤溪县| 峨边| 阜南县| 黄大仙区| 叙永县| 阜城县| 色达县| 上犹县| 剑河县|