sss

.h檔

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController<UITextFieldDelegate>//TextField的協定

@end

.m檔

sh932111 發表在 痞客邦 留言(0) 人氣()

螢幕快照 2013-11-30 下午2.33.21

表格的應用真的很廣泛

而且自由度也很高

像是改變高度或是按下後改變圖片等等

.h檔的部份

#import <UIKit/UIKit.h>

sh932111 發表在 痞客邦 留言(0) 人氣()

螢幕快照 2013-11-29 下午6.44.38

//顯示一張圖片

UIImage *your_image=[UIImage imageNamed:@"monkey.jpg"];//使用UIImage放置圖片

UIImageView *your_imageview =[[UIImageView alloc]initWithFrame:CGRectMake(50.0f, 50.0f, 100.0f, 100.0f)];//初始化UIImageView的物件並且設定位置及大小

your_imageview.image=your_image;//指定UIImage的物件顯示圖片

[self.view addSubview:your_imageview];//將設定好的UIImageView加到view裡面

sh932111 發表在 痞客邦 留言(0) 人氣()

螢幕快照 2013-11-29 上午9.44.57

UILabel *Your_Label_1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 40, 280, 80)]; //初始化Label元件

Your_Label_1.backgroundColor = [UIColor yellowColor];//設定背景的顏色

Your_Label_1.text = @"Label_line1_test \nLabel_line2_test";//設定顯示的內文

Your_Label_1.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];//設定文字的樣式以及大小

Your_Label_1.textAlignment = UITextAlignmentCenter;//對齊方式 UITextAlignmentLeft是靠左 UITextAlignmentRight是靠右

sh932111 發表在 痞客邦 留言(0) 人氣()

Button_image

 //設定UIButton

UIButton *Your_button_1;

UIButton *Your_button_2;

UIButton *Your_button_3;

//設定圖片在按鈕上

sh932111 發表在 痞客邦 留言(0) 人氣()

1
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。