UITextField

UITextField


// create text field
UITextField *textField = [[UITextField alloc] initWithFrame: CGRectMake(50,50,200,40)];
// set some properties
textField.placeholder = @"please enter your id"; // set default text
textField.backgroundColor = [UIColor yellowColor]; // set background color
textField.autocorrectionType = UITextAutocorrectionTypeNo; // !!!! this is important
// add it to view
[[[CCDirector sharedDirector] openGLView] addSubview:textField];

posted on 2013-01-15 23:25  紫澜  阅读(165)  评论(0编辑  收藏  举报