One:
Effect Description: Click on the blank space to quickly recycle the keyboard
Two: Engineering drawings
Three: Code area
AppDelegate.h
#import <UIKit/UIKit.h>@interface appdelegate:uiresponder <UIApplicationDelegate> *window; @end
Appdelegate.m
#import "AppDelegate.h"#import "RootViewController.h"@interfaceappdelegate ()@end@implementationappdelegate- (void) dealloc{Self.window=Nil; [Super Dealloc];}-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchoptions {Self.window=[[[UIWindow alloc] initwithframe:[[uiscreen mainscreen] bounds]] autorelease]; //Override point for customization after application launch.Rootviewcontroller *rootview =[[Rootviewcontroller alloc] init]; Uinavigationcontroller*NAVIGATIONVC =[[Uinavigationcontroller Alloc]initwithrootviewcontroller:rootview]; Self.window.rootViewController=NAVIGATIONVC; [Rootview release]; [NAVIGATIONVC release]; Self.window.backgroundColor=[Uicolor Whitecolor]; [Self.window makekeyandvisible]; returnYES;}@end
RootViewController.h
#import <UIKit/UIKit.h>@interface rootviewcontroller:uiviewcontroller@end
Rootviewcontroller.m
#import "RootViewController.h"@interfaceRootviewcontroller () @property (nonatomic, retain) Uitextfield*Text1, @property (nonatomic, retain) Uitextfield*Text2, @property (nonatomic, retain) Uitextfield*Text3;@end@implementationRootviewcontroller- (void) viewdidload {[Super viewdidload]; //Do any additional setup after loading the view.[self showtext];}
#pragma mark-Create a control
- (void) Showtext {self.text1= [[Uitextfield alloc] Initwithframe:cgrectmake ( -, -,260, +)]; _text1.borderstyle=2; Self.text2= [[Uitextfield alloc] Initwithframe:cgrectmake ( -, the,260, +)]; _text2.borderstyle=2; Self.text3= [[Uitextfield alloc] Initwithframe:cgrectmake ( -, -,260, +)]; _text3.borderstyle=2; [Self.view Addsubview:_text1]; [Self.view ADDSUBVIEW:_TEXT2]; [Self.view ADDSUBVIEW:_TEXT3]; [_text1 release]; [_text2 release]; [_text3 release];}
#pragma mark-The core code of the recovery keyboard
-(void) Touchesbegan: (Nsset *) touches withevent: (uievent *)event { [self.text1 Resignfirstresponder]; [Self.text2 Resignfirstresponder]; [Self.text3 Resignfirstresponder]; } -(void) didreceivememorywarning { [super didreceivememorywarning]; // Dispose of any resources the can be recreated. }@end
Recycle the keyboard by clicking on the space