按鈕出現的時候有動畫效果,按鈕出現動畫效果 代碼:- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIButton *button=[UIButton buttonWithType:UIButtonTypeRoundedRect];
淡出淡入,淡入- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //UIView UIView *view=[[UIView alloc]initWithFrame:CGRectMake(10, 100, 100, 200)];
擷取字串的寬度和高度,擷取字串寬度 代碼:- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //擷取字串的寬度 NSLog(@"獲得字串的寬度:%f",[self widthForString:@"我愛你!我愛你!我愛你!我愛你!我愛你!我愛你!我愛你!我愛你!"
Block 簡介,block簡介1、Blocks簡介 Block字面意思就是代碼塊 iOS4.0、Mac OS X 10.6開始Apple引入的特性 Block是Objective C語言中的對象 但是與NSObject有所區別 Block是特殊的Objective C對象 Block 對象提供了一個使用 C 語言和 C 派生語言(如 Objective-C 和
網路請求圖片,請求圖片 : 代碼:- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
獲得現在所有的是周幾,獲得有的是周代碼:- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. NSLog(@"現在所在的周:%@",[self getWeekFromLocal]);
判斷textField裡面是否有空,判斷textField有空 : 代碼:- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //TextField UITextField *textField=[[UITextField