I was reading text programming guide for ios and came across this line:
Just after a text object becomes first responder textFieldDidBeginEditing:
(text field) and textViewDidBeginEditing:
(text view). The delegate
can respond to this message by updating state information or, for example, by showing an overlay view during the editing session.
I want to ask what is overlay view?? can you give example please.
这是UIKeyboard
后出现UITextField
成为第一个响应者,如果你只是为了告知UITextField
由重叠UIKeyboard
Overlays can be anything the you add on a view, for example you can insert a map view, but when you show a route on that map or drop a pin on some location then that is adding an overlay view.
While using MPPlayer Controller you will come across many overlays, called the main view, video view, bottom bar, Bottom bar buttons, Play video buttons. When you check the 3D hierarchy (debug view hierarchy) then you will see different layers for these items. I had to remove just the bottom bar on tap gesture so i had to check that subview and remove it. I have also inserted code for that.
- (void)showControls { for(id views in [[player view] subviews]){ for(id subViews in [views subviews]){ for (id controlView in [subViews subviews]){ if ( [controlView isKindOfClass:NSClassFromString(@"MPVideoPlaybackOverlayView")] ) { [controlView setAlpha:1.0]; [controlView setHidden:NO]; } } } } } - (void)hideControls { if (self.menuPopover) { [self.menuPopover removeFromSuperview]; self.menuPopover=nil; } for(id views in [[player view] subviews]){ for(id subViews in [views subviews]){ for (id controlView in [subViews subviews]){ if ( [controlView isKindOfClass:NSClassFromString(@"MPVideoPlaybackOverlayView")] ) { [controlView setAlpha:0.0]; [controlView setHidden:YES]; } } } } }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.