gpt4 book ai didi

iphone - 如何设置 UITextfield 的边框样式

转载 作者:IT王子 更新时间:2023-10-29 07:55:11 30 4
gpt4 key购买 nike

如何以编程方式设置 UITextField 的边框样式?

我正在这样创建我的文本字段:

UITextField *tfText = [[UITextField alloc] initWithFrame:CGRectMake(65, 200, 200, 30)];
tfText.backgroundColor = [UIColor colorWithRed:0.2 green:0.9 blue:0.5 alpha:0.3];
tfText.textAlignment = UITextAlignmentCenter;
[self.view addSubview:tfText];
[tfText release];

最佳答案

试试这个

UITextField *tfText = [[UITextField alloc] initWithFrame:CGRectMake(65, 200, 200, 30)];
tfText.backgroundColor = [UIColor colorWithRed:0.2 green:0.9 blue:0.5 alpha:0.3];
tfText.textAlignment = UITextAlignmentCenter;
// Border Style None
[tfText setBorderStyle:UITextBorderStyleNone];
[self.view addSubview:tfText];
[tfText release];

供引用

关于iphone - 如何设置 UITextfield 的边框样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5789816/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com