[Cpp]
-(Id) init
{
Self = [super init];
If (self ){
Self. wantsFullScreenLayout = YES;
[UIApplication sharedApplication]. statusBarStyle = UIStatusBarStyleBlackTranslucent;
[[Nsicationcenter center defacenter center] addObserver: self selector: @ selector (keyboardWillChangeFrame :) name: UIKeyboardWillShowNotification object: nil];
[[Nsicationcenter center defacenter center] addObserver: self selector: @ selector (keyboardWillChangeFrame :) name: UIKeyboardWillHideNotification object: nil];
}
Return self;
}
[Cpp]
-(Void) loadview
{
Titlefield. delegate = self;
}
[Cpp]
# Pragma mark-
# Pragma mark-textfield delete
-(Void) textFieldDidBeginEditing :( UITextField *) textField
{
}
-(Void) textFieldDidEndEditing :( UITextField *) textField
{
[Self adjustPanelsWithKeybordHeight: 0];
}
-(BOOL) textFieldShouldReturn :( UITextField *) textField
{
NSLog (@ "shocould return ");
[Self. sendpanel. titlefield resignFirstResponder];
Return YES;
}
-(Void) keyboardWillChangeFrame :( NSNotification *) notification
{
NSLog (@ "keyboardWillChangeFrame ");
NSValue * keyboardBoundsValue = [[notification userInfo] objectForKey: UIKeyboardFrameEndUserInfoKey];
CGRect keyboardBounds;
[KeyboardBoundsValue getValue: & keyboardBounds];
NSLog (@ "height = % f", keyboardBounds. size. height );
[Self adjustPanelsWithKeybordHeight: keyboardBounds. size. height];
}
-(Void) adjustPanelsWithKeybordHeight :( float) height
{
Sendpanel. frame = CGRectMake (0, 435-height, sendpanel. frame. size. width, sendpanel. frame. size. height );
Progresspanel. frame = CGRectMake (0, 400-height, progresspanel. frame. size. width, progresspanel. frame. size. height );
}
[Html]
-(Void) dealloc
{
[[Nsicationcenter center defacenter center] removeObserver: self name: UIKeyboardWillShowNotification object: nil];
[[Nsicationcenter center defacenter center] removeObserver: self name: UIKeyboardWillHideNotification object: nil];
}