iPhone – 如何呈现半屏幕模态视图?

前端之家收集整理的这篇文章主要介绍了iPhone – 如何呈现半屏幕模态视图?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个UIViewController,当按下一个按钮时,我想要一个半屏视图,用UIPicker向上滑动.

我在IB中使用UIPicker创建了一个UIView,还有一个带有完成/取消按钮的UIToolBar.

我怎样才能使这个半视图向上滑动,背景视图仍然显示但是暗淡或无法播放.

到目前为止我正在使用此代码

- (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,self.view.frame.size.height)];
    }];
}

这是一张照片:http://www.box.net/shared/static/08ji4s0f6i1b8qubrtz6.png

解决方法

这就是你需要在github TDSemiModalView上有一个半视图日期选择器的开源代码.检查代码中的演示项目.这是链接..希望它能解决您的问题.

TDSemiModalClass

猜你在找的Xcode相关文章