开发者

How to dismiss the iPhone number pad?

Is there any simple method other than the one seen in

http://www.neoos.ch/news/46-development/54-uikeyboardtypenumberpad-and-the-missing-return-key

to dismiss a Numbe开发者_如何学JAVAr pad in iPhone??

This code for a single text Field seems a lot.!!


You can also do this by casting the background view to be a UIControl and then hook up a touch event to the controller's [self.view endEditing:YES];

How to dismiss the iPhone number pad?

You do this by changing the class of the base view in the xib to to be a UIControl instead of UIView

This means that the keyboard can be dismissed by touching the background.


HI Finally from all the suggestions i Got it!!

Make your keyboard as Number Pad on Xib and put the following code in the .m file after connecting all the textFields..

-(void)touchesBegan NSSet *)touches withEvent UIEvent *)event
{
    [txt11 resignFirstResponder];
    [txt22 resignFirstResponder];
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜