[iOS] hide keyboard on iPad when guide vc is scrolled

This commit is contained in:
Kirill Zhdanovich 2013-08-09 00:57:23 +03:00
parent 34cdc7903c
commit 87b4adc2f1
3 changed files with 14 additions and 4 deletions

View file

@ -10,4 +10,5 @@
//uses on start of application
-(NSString *)getDefaultArticle;
-(NSString *)getArticleName:(NSString *)htmlId;
-(void)killKeyboard;
@end

View file

@ -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

View file

@ -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