开发者

show uiview on top of everything (even keyboard)

开发者 https://www.devze.com 2023-03-31 12:27 出处:网络
In my application, I sometimes show a message to the user and I want it to be on top of everything (even keyboard), like a UIAlertView could do.

In my application, I sometimes show a message to the user and I want it to be on top of everything (even keyboard), like a UIAlertView could do.

I googled it and found the solution which is:

    [[[[UIApplication sharedApplication] delegate] window] addSubview:myViewOnTo开发者_如何学JAVAp];

This works. However this is not documented, so I guess Apple won't accept it, right ?

What do you think about it ? Do you know an Apple legacy way to do it ?

Thanks

Vincent


UIWindow is just a subclass of UIView. Therefore the addSubView function is documented which should make it acceptable :)


addSubView: is documented and should not be a problem. However, you should ensure that you do not violate one of the gazillion clauses included in the Human Interface Guidelines.


Add your view directly to the keyWindow.

0

精彩评论

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