其實我有一個文本字段。KeyBoard隱藏方法我需要動畫嗎?
其目的是使用視圖和滾動視圖來顯示和隱藏鍵盤。
一切都很好,但每當鍵盤隱藏視圖下降沒有任何動畫。我的意思是它非常快,在我的iphone上看起來不錯。
我想視圖慢慢倒下。
對於主要是我使用這個代碼..
CGPoint p=CGPointMake(0,0);
[srlvJuiceandSmoothireDetail1 setContentOffset:p animated:YES];
我可以設置動畫的持續時間,其實我也是不知道,這種方法是值得與否。
在鍵盤上顯示這是值得...
一些Code..for refrence ...
- (void) keyboardDidHide:(NSNotification *)notif {
if (!keyboardVisible_) {
NSLog(@"%@", @"Keyboard already hidden. Ignoring notification.");
return;
}
// CGRect viewFrame = scrlView;
srlvJuiceandSmoothireDetail1.frame = scrlView;
CGPoint p=CGPointMake(0,0);
[srlvJuiceandSmoothireDetail1 setContentOffset:p animated:YES];
keyboardVisible_=NO;
}
感謝它很好.... –
但UIKeyboardAnimationDurationUserInfoKey不工作,所以,我已經手動設置它.. –