[iOS] hide keyboard on iPad when guide vc is scrolled
This commit is contained in:
parent
34cdc7903c
commit
87b4adc2f1
3 changed files with 14 additions and 4 deletions
|
@ -10,4 +10,5 @@
|
|||
//uses on start of application
|
||||
-(NSString *)getDefaultArticle;
|
||||
-(NSString *)getArticleName:(NSString *)htmlId;
|
||||
-(void)killKeyboard;
|
||||
@end
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
|
||||
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
|
||||
{
|
||||
[self.searchBar resignFirstResponder];
|
||||
[self killKeyboard];
|
||||
}
|
||||
|
||||
#pragma mark - UISearchBarDelegate
|
||||
|
@ -177,4 +177,9 @@
|
|||
return [NSString stringWithUTF8String:tmp->GetTitle().c_str()];
|
||||
}
|
||||
|
||||
-(void)killKeyboard
|
||||
{
|
||||
[self.searchBar resignFirstResponder];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{
|
||||
_webView = [[UIWebView alloc] init];
|
||||
[self.webView setFrame:self.view.frame];
|
||||
UIPinchGestureRecognizer * pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(onPinch:)];
|
||||
UIPanGestureRecognizer * pinch = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(onPinch:)];
|
||||
pinch.delegate = self;
|
||||
[self.webView addGestureRecognizer:pinch];
|
||||
self.webView.delegate = self;
|
||||
|
@ -106,9 +106,13 @@
|
|||
return static_cast<unsigned int>(100 * m_webViewScale);
|
||||
}
|
||||
|
||||
-(void)onPinch:(UIPinchGestureRecognizer *)sender
|
||||
-(void)onPinch:(UIPanGestureRecognizer *)sender
|
||||
{
|
||||
// @todo kill keyboard after search UINOTIFICATION
|
||||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
|
||||
{
|
||||
UISplitViewController * splitControl = (UISplitViewController *)[[UIApplication sharedApplication] delegate].window.rootViewController;
|
||||
[[splitControl.viewControllers objectAtIndex:0] killKeyboard];
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer
|
||||
|
|
Reference in a new issue