File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,17 @@ - (void) onExitTransitionDidStart
165165
166166- (void ) update : (CCTime)delta
167167{
168- [self positionTextField ];
168+ BOOL isVisible = self.visible ;
169+ if (isVisible) {
170+ // run through ancestors and see if we are visible
171+ for (CCNode *parent = self.parent ; parent && isVisible; parent = parent.parent )
172+ isVisible &= parent.visible ;
173+ }
174+
175+ // hide the UITextField if node is invisible
176+ _textField.hidden = !isVisible;
177+
178+ if (isVisible) [self positionTextField ];
169179}
170180
171181- (void ) layout
@@ -189,6 +199,11 @@ - (void) layout
189199 [super layout ];
190200}
191201
202+ - (void ) setEnabled : (BOOL )enabled {
203+ _textField.enabled = enabled;
204+ [super setEnabled: enabled];
205+ }
206+
192207#pragma mark Text Field Delegate Methods
193208
194209#ifdef __CC_PLATFORM_IOS
You can’t perform that action at this time.
0 commit comments