一.貼圖為快
二.知識點
1.文本
2.鍵盤
1>自動隱藏,方法1:Did End on Exit事件,添加hideKeyboard方法,調用resignFirstResponder讓讓輸入對象放棄其擷取輸入的權利;
方法2:(主要針對數字鍵台)觸摸背景來隱藏鍵盤。
2>Keyboard屬性,預設,Number Pad,Email Address等。
3.按鈕
1>給按鈕添加背景圖片,在視圖載入時設定,
- (void)viewDidLoad{
//在視圖載入時設定按鈕模板
UIImage *normalImage = [[UIImage imageNamed:@"whiteButton.png"] stretchableImageWithLeftCapWidth:12.0 topCapHeight:0.0];
UIImage *pressedImage = [[UIImage imageNamed:@"blueButton.png"] stretchableImageWithLeftCapWidth:12.0 topCapHeight:0.0];
[self.theButton setBackgroundImage:normalImage forState:UIControlStateNormal];
[super viewDidLoad];
[self.theButton setBackgroundImage:pressedImage forState:UIControlStateHighlighted];
}
2>createStory方法
self.theStory.text=[self.theTemplate.text stringByReplacingOccurrencesOfString:@"<place>" withString:self.thePlace.text];
self.theStory.text=[self.theStory.text stringByReplacingOccurrencesOfString:@"<verb>" withString:self.theVerb.text];
self.theStory.text=[self.theStory.text stringByReplacingOccurrencesOfString:@"<number>" withString:self.theNumber.text];