通過顏色來產生一個純色的圖片,產生純色圖片 :代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
利用圖片序列建立動態圖片效果,圖片序列建立動態代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. //顯示圖片的UIImageView UIImageView *imageview=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
根據size截取螢幕中間矩形地區,size截取螢幕矩形代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
iphone開發之擷取系統字型,iphone開發字型代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. NSLog(@"--系統的所有字型--%@",[self getAllSystemFonts]); NSLog(@"--系統當前字型--%@",[self getCurrentFont]);
UIAlertView自動半閉,UIAlertView半閉 : 代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. //alert UIAlertView *alert=[[UIAlertView alloc]initWithTitle:nil message:@"一個可以自動關閉的Alert視窗"
UITextField設定placeholder顏色,uitextfield:代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. UITextField *textField=[[UITextField alloc]initWithFrame:CGRectMake(50, 100, 200, 50)];