I display开发者_如何学Goed 20 buttons on the view(almost the view is covered with bottons images), now I want to display information using animations on the top of all these buttons like UIAlertView.
Now I am displaying the alert view but instead of that I need to display the animated view on the top of all the buttons.
How can I achieve it, is there any idea to display the information on the top of all the buttons using view animations.
Please help me, thank you, Madan Mohan.
Madan for this you will need two views. If you observe behavior of UIAlertView
then you will find that when alert view is shown we can not interact with any other item on the view. So one view will serve the purpose for alertview and other will block interaction with UI
.
You can do this as follows:
Have two views on your self.view
. One view will hold all the elements that are currently on the self.view and other will have alertview
. so hierarchy goes like this
self.view
|------------View1
| |-----it will have all buttons and other ui that were earlier on self.view
|
|-------------View2
|------it will have a uiview which you will make,look like alertview.
initially view1 will be at front and view2 will be added at back.
Now how to piece all this together.
When user will tap on any button the you will need to bring backview to front inside [UIView beginanimation]
and other animation code and commite it.
and when user is done with this view you will send it to back.
Also, to make transparent look as we have when alertview
is shown, set View2's backgroundColor
black and alpha
property 0.3 (or as you wish).
Thanks,
精彩评论