show uiview on top of everything (even keyboard)
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.
精彩评论