开发者

Hide keyboard in ipad

开发者 https://www.devze.com 2023-03-28 03:19 出处:网络
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:

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

精彩评论

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