// created by 郭仔 2023年04月17日23:30:33
***************===
沒什麼時間了,直接上**:
***************===
uiimageview:
// ***************==uiimageview***********************************=
uiimageview * imageview = [[uiimageview alloc]initwithframe:cgrectmake(100, 200, 50, 50)];
imageview.image = [uiimage imagenamed:@"3"];
[imageview.layer setshadowcolor:[uicolor greencolor].cgcolor];
imageview.layer.shadowoffset = cgsizemake(5, 5);
// 設定不透明度
imageview.layer.shadowopacity = 0.5;
nsmutablearray * images = [nsmutablearray array];
for (int i = 7; i < 13; i ++)
imageview.animationimages = images;
// 設定動畫間隔,必須在startanimating之前設定間隔
imageview.animationduration = 1;
[imageview startanimating];
= uiviewcontentmodescaleaspectfill;
// imageview.contentmode = uiviewcontentmodetop;
// 25把我自己的變成圓形,這裡的25代表的是半徑
imageview.layer.cornerradius = 25;
[imageview.layer setmaskstobounds:yes];
[self.window addsubview:imageview];
[imageview release];
*************************=
uislider:
#pragma mark - uislider
uislider * slider = [[uislider alloc]initwithframe:cgrectmake(50, 200, 200, 50)];
slider.minimumvalue = 100;
slider.maximumvalue = 200;
// 設定讓slider倒立(即豎直方向)
// slider.transform = cgaffinetransformmakerotation(m_pi_2);
// 設定劃過的區域的顏色
slider.minimumtracktintcolor = [uicolor blackcolor];
// slider.tintcolor = [uicolor redcolor];
// 設定未劃過區域的顏色
slider.maximumtracktintcolor = [uicolor redcolor];
uiimage * img = [uiimage imagenamed:@"3"];
[slider setthumbimage:img forstate:uicontrolstatenormal];
slider.thumbtintcolor = [uicolor bluecolor];
[slider addtarget:self action:@selector(sliderchanged:) forcontrolevents:uicontroleventvaluechanged];
[self.view addsubview:slider];
[slider release];
***********************************==
uisegment:
#pragma mark - uisegmentedcontrol
nsarray * items = [nsarray arraywithobjects:@"首頁",@"列表",@"收藏", nil];
uisegmentedcontrol * seg = [[uisegmentedcontrol alloc]initwithitems:items];
seg.frame = cgrectmake(30, 50, 250, 30);
seg.tintcolor = [uicolor blackcolor];
[seg insertsegmentwithtitle:@"我的頁面" atindex:1 animated:yes];
seg.selectedsegmentindex = 2;
[seg addtarget:self action:@selector(segclicked:) forcontrolevents:uicontroleventvaluechanged];
[self.view addsubview:seg];
[seg release];
***********************************==
uicontrol:
uicontrol的核⼼心功能:
為控制控制項通過addtarget: action: forcontrolevents: ⽅方法來新增事 件。
通過removetarget: action: forcontrolevents: 來移除事件。
***********************************==
小結:
***********************************==
這次太晚了,到家就要12點了~~~~~~~~~~~~
iOS開發 UI 動畫
import viewcontroller.h inte ce viewcontroller property nonatomic,strong uiview myview 轉場動畫 切換的檢視 property nonatomic,strong uiview firstview property ...
Android開發 UI布局
什麼是線性布局?其實呢,線性布局就是把孩子們都放在同一條線上!1.線性布局的使用 2.線性布局擺放的方向 android orientation vertical 我們可以通過orientation這個屬性來修改linearlayout布局的孩子擺放方向,它的值有兩個 乙個是vertical 垂直方...
Android開發 UI元件
android id android layout width android layout height android background 自定義背景顏色 android layout margin 外邊距,距離外部元素的邊距 android layout padding 內邊距 androi...