modalPresentationStyle兑现特殊的弹出效果

modalPresentationStyle实现特殊的弹出效果
要实现这种弹出框使周围成灰色并且不可触摸很简单,只需要三行代码:

controller.modalPresentationStyle=UIModalPresentationFormSheet;

[self presentModalViewController:controller animated:YES];

[controller release];

controller是你想要添加的类的对象,这里就不多解释。查阅文档发现

UIModalPresentationStyle包含了多种样式弹出:

UIModalPresentationFullScreen,

UIModalPresentationPageSheet,

UIModalPresentationFormSheet,

UIModalPresentationCurrentContext大家可以更替代码中相应位置试试看。