UIView的簡單實用

2022-08-21 22:24:09 字數 1067 閱讀 9754

在ios ui中uiview的簡單使用的方法

uiview的使用

1、建立:uiview *view = [[uiview alloc]init];//建立座標為(0,0),寬高均為0的檢視

uiview *view = [[uiview alloc] initwithframe: cgrectmake(10, 10, 100, 50)];//建立乙個相對父檢視座標為(10,10),寬100,高50的檢視

2、 view.frame = cgrectmake(20, 10, 100, 50);//設定view的座標及尺寸

3、 view.userinteractionenabled = no;//是否響應使用者互動(觸控)

4、 view.tag = 1;//設定檢視的標籤

5、 uiview *view3 = [view viewwithtag:1];//將view子檢視中標籤為3的檢視賦值給view3

6、 -(void) addsubview:(uiview *)view;//新增子檢視

[view addsubview:view2];將view2加到view上

7、 -(void) removefromsuperview;//從父視窗上刪除子檢視(自己)

[view removefromsuperview];

8、 [view insertsubview:view1 atindex:0];//在view的第0層插入乙個子檢視

9、 [view insertsubview:view1 belowsubview:view2]; //將view1子檢視新增到view2子檢視下

10、 [view insertsubview:view1 abovesubview:view2]; //將view1子檢視新增到view2子檢視下

11、 view.backgroundcolor = [uicolor whitecolor];//設定背景色

12、 view.alpha = 1;//設定view的透明度,0~1透明到不透明

13、 view.hidden = yes;//是否隱藏view

ListView的簡單實用

獲得陣列的 typedarray image getresources obtaintypedarray r.array.image int imageid new int image.length 獲得陣列對應的id for int i 0 i image.length i 獲得陣列的字串 str...

sqoop的簡單實用

sqoop安裝 安裝在一台節點上就可以了。1.上傳sqoop 2.安裝和配置 在新增sqoop到環境變數 將資料庫連線驅動拷貝到 sqoop home lib裡 3.使用 第一類 資料庫中的資料匯入到hdfs上 sqoop import connect jdbc mysql 192 168.1 10...

curl的簡單實用

curl四部曲,複雜之處在於 設定選項 非常多 以下只是挑選個人常用的列出來 1.初始化 curl init 2.設定選項 curl setopt 3.執行並獲取結果 curl exec 4.釋放curl curl close 一.get方式實現 ch curl init curl setopt c...