Skip to content

fix issues of textfield #20303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cocos/platform/ios/CCEAGLView-ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.
@property(nonatomic,readonly) EAGLContext *context;

@property(nonatomic,readwrite) BOOL multiSampling;
@property(nonatomic, readonly) BOOL isKeyboardShown;


/** CCEAGLView uses double-buffer. This method swaps the buffers */
Expand All @@ -132,5 +133,4 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved.

-(void) showKeyboard;
-(void) hideKeyboard;
-(BOOL) isKeyboardShown;
@end
7 changes: 1 addition & 6 deletions cocos/platform/ios/CCEAGLView-ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE

@interface CCEAGLView ()
@property (nonatomic) CCInputView* textInputView;
@property(nonatomic) BOOL isKeyboardShown;
@property(nonatomic, readwrite, assign) BOOL isKeyboardShown;
@property(nonatomic, copy) NSNotification* keyboardShowNotification;
@property(nonatomic, assign) CGRect originalRect;
@end
Expand Down Expand Up @@ -472,11 +472,6 @@ - (void) hideKeyboard
[self.textInputView removeFromSuperview];
}

-(BOOL) isKeyboardShown
{
return self.isKeyboardShown;
}

-(void) doAnimationWhenKeyboardMoveWithDuration:(float) duration distance:(float) dis
{
[UIView beginAnimations:nil context:nullptr];
Expand Down
3 changes: 1 addition & 2 deletions cocos/platform/ios/CCInputView-ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ - (BOOL) canBecomeFirstResponder {
return YES;
}

- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[self resignFirstResponder];
[self removeFromSuperview];
}


#pragma TextInput protocol

- (id<UITextInputDelegate>)inputDelegate {
Expand Down