我需要一個視圖來彈出並讓用戶登錄。我無法明顯地使用動作表,因爲他們只有按鈕。如何使UIView充當動作表?
所以我想要一個UIView上滑而不是。
我創建了UIView,名爲CustomModalView。
看來我需要像這樣的代碼:
- (IBAction)showTapped:(id)sender {
[UIView animateWithDuration:.5 animations:^{
subView.frame=CGRectMake(0, 225, subView.frame.size.width, subView.frame.size.height);
}];
}
- (IBAction)hideTapped:(id)sender {
[UIView animateWithDuration:.5 animations:^{
subView.frame=CGRectMake(0, 480, subView.frame.size.width, subView.frame.size.height);
}];
}
但我新的目標C,我不知道如何定製這個我自己的項目......我甚至不知道把這個代碼放在哪裏。任何幫助將不勝感激。
您可以根據需要自定義UIView,然後根據需要放置UIButton。 –
'presetnModelVieController'而不是視圖。 –