【发布时间】:2011-10-17 23:18:04
【问题描述】:
我有一个 UIViewController,当按下按钮时,我想要一个半屏视图向上滑动,其中包含一个 UIPicker。
我在 IB 中使用 UIPicker 以及带有完成/取消按钮的 UIToolBar 制作了一个 UIView。
我怎样才能让它只有这个半视图向上滑动并且背景视图仍然显示但变暗或无法播放。
到目前为止,我正在使用此代码:
- (void)showModalView
{
[self.popupView setFrame:CGRectMake(0, self.view.frame.size.height, self.view.frame.size.width, self.view.frame.size.height)];
[self.view addSubview:self.popupView];
[UIView animateWithDuration:.2 animations:^{
[self.popupView setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
}];
}
这是一张照片:http://www.box.net/shared/static/08ji4s0f6i1b8qubrtz6.png
【问题讨论】:
标签: iphone objective-c xcode uiviewcontroller modalviewcontroller