ios 直接设置的内容输入框不显示

-(id) initWithFrame: (CGRect) frameRect editBox: (void*) editBox
{
self = [super init];

do
{
if (self == nil) break;
editState_ = NO;
self.textField = [[[CustomUITextField alloc] initWithFrame: frameRect] autorelease];
if (!textField_) break;
[textField_ setTextColor:[UIColor whiteColor]];
textField_.font = [UIFont systemFontOfSize:frameRect.size.height*2/3]; //TODO need to delete hard code here.
textField_.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
textField_.backgroundColor = [UIColor clearColor];
textField_.borderStyle = UITextBorderStyleNone;
textField_.delegate = self;
textField_.returnKeyType = UIReturnKeyDefault;
[textField_ addTarget:self action:@selector(textChanged) forControlEvents:UIControlEventEditingChanged];
self.editBox = editBox;

//add by ix 2014-
[[EAGLView sharedEGLView] addSubview:textField_];
textField_.hidden = YES;

return self;
}while(0);

return nil;
}

posted on 2014-06-10 16:16  the seal  阅读(668)  评论(0编辑  收藏  举报