开发者

(iphone) difference between modal view and UIAlertView?

I wanted to present a semi-transparent modal view.

From many other stackoverflow posts, (eg Transparent Modal View on Navigation Controller)

It seems common approach to this is

Create a view,

Add the view to some superview with animation,

instead of using pushMo开发者_JAVA百科dalViewController.

On second thought, I realize there is UIAlertView,

and it seems to satisfy the requirement (semi-transparent modal view).

Since UIAlertView is a view(you can make the view transparent),

and it is modal(prevents user from doing anything else) by nature.

I haven't looked at UIAlertView closely but why do people bother with creating own view and animation.

Is there a limitation of UIAlertView that forces many people to avoid it for this purpose?

Thank you


I think it is because you would be forced to delete and customize the items that are present on the UIAlertView and you can't know for sure how the memory and other elements may react to that. In the end it is finally easier and more secure just to do a new modalView with the elements you have and not mess around with UIAlertView, plus if you want to use the UIAlertView way you would have to do everything programmatically while there are ways to configure the modalView on IB.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜