我想在單擊TextField時移動視圖,但當我們更改文本或編寫任何內容時,它只能在textDidChange
上工作,因此當單擊TextField時如何調用方法。如何調用點擊文本文件時的方法比文本更改
-(void)textFieldTextDidChange:(UITextField*)tf{
[self showAnimationPests];
}
-(void) showAnimationPests{
[UIView animateWithDuration:0.5
animations:^{
self.view.frame = CGRectMake(0,-300,1024,768);
}];
}
代替textchange我想在文本框單擊
在.h文件中
IBOutlet UIButton*button1;
IBOutlet UIButton*button2;
IBOutlet UIButton*button3;
IBOutlet UIButton*button4;
IBOutlet UIButton*button5;
IBOutlet UIButton*button6;
IBOutlet UIButton*button7;
IBOutlet UIButton*button8;
IBOutlet UIButton*button9;
IBOutlet UIButton*button10;
@property(nonatomic,retain)IBOutlet UIButton*button1;
@property(nonatomic,retain)IBOutlet UIButton*button2;
@property(nonatomic,retain)IBOutlet UIButton*button3;
@property(nonatomic,retain)IBOutlet UIButton*button4;
@property(nonatomic,retain)IBOutlet UIButton*button5;
@property(nonatomic,retain)IBOutlet UIButton*button6;
@property(nonatomic,retain)IBOutlet UIButton*button7;
@property(nonatomic,retain)IBOutlet UIButton*button8;
@property(nonatomic,retain)IBOutlet UIButton*button9;
@property(nonatomic,retain)IBOutlet UIButton*button10;
不能清楚地理解你想要什麼..? –
開始接受正確和有用的答案,否則人們將開始忽視給你答案。 – Tirth