2011-11-27 53 views
4

是否可以使用presentModalViewController显示不规则形状的模态视图?模式部分覆盖屏幕(演示风格设置为UIModalPresentationFormSheetiPad上不规则形状的模态视图

我试图简单地将超级视图clipsToBounds设置为NO,它没有工作。我似乎也无法摆脱圆角。

PS:我想避免必须手动创建自定义视图。

PPS:我从我们都应该使用presentViewController现在的iOS 5,它没有完成任何事情不同虽然文档注意。

回答

4

我有点得到它的工作。这是一个黑客,但它的作品。

的代码(这是谁酿出模态控制器内):

// Present the modal 
[self presentViewController:modalVC animated:YES completion:NULL]; 

// Let content overflow and shrink superview to a small dimension 
modalVC.view.clipsToBounds = NO; 
modalVC.view.superview.bounds = CGRectMake(modalVC.view.superview.bounds.origin.x, modalVC.view.superview.bounds.origin.y, 100, 100); 

现在只是做模态的看法比上海华大,你可以去疯狂的形状。

注意,倒是会只在上海华登记注册。

+0

甜,感谢和+1 – PeterPurple