开发者

Hide keyboard in ipad

How can I hide my keyboard when I click on my UIImageView?

I am trying to use this soution but it does not work with UIImageView:

- (IBAction)backgroundTap:(id)sender 
{

logLang.hidden=YES;
pasComp.hidden=YES; 
[login resignFirstResponder];
[pass开发者_运维技巧word resignFirstResponder];


}


Make sure your image view user interaction enabled in xib? if you are adding your imageView pro grammatically then

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

        UITouch *touch = [touches anyObject];

        if ([touch view] == yourImageView) {
             logLang.hidden=YES;
             pasComp.hidden=YES; 
             [login resignFirstResponder];
             [password resignFirstResponder];
        }
 }

use the UIResponder methods touchesBegan, touchesMoved, touchesEnded etc to detect the touch on the image view

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜