您的位置:首页 > 产品设计 > UI/UE

ios: UI学习总结(user Interface) UITextField

2014-11-26 09:50 274 查看
1、UITextField:

#pragma mark 通过代码创建UITextField

-(void)makeUITextFieldWithSourcecode{

    UITextField *textField =[[UITextField alloc]initWithFrame:CGRectMake(100, 100, 200, 30)];

    [textField setTextAlignment:NSTextAlignmentCenter];

    textField.font = [UIFont systemFontOfSize:20];

    [textField setBackgroundColor:[UIColor redColor]]; //注意要给UITextField设置background(图片或者color)否则在界面上会看不到

    [self.view addSubview:textField];

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: