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
165
165
166
166
- (void ) update : (CCTime)delta
167
167
{
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 ];
169
179
}
170
180
171
181
- (void ) layout
@@ -189,6 +199,11 @@ - (void) layout
189
199
[super layout ];
190
200
}
191
201
202
+ - (void ) setEnabled : (BOOL )enabled {
203
+ _textField.enabled = enabled;
204
+ [super setEnabled: enabled];
205
+ }
206
+
192
207
#pragma mark Text Field Delegate Methods
193
208
194
209
#ifdef __CC_PLATFORM_IOS
You can’t perform that action at this time.
0 commit comments