gpt4 book ai didi

ios - UITextField 设置边框

转载 作者:行者123 更新时间:2023-11-28 22:23:34 28 4
gpt4 key购买 nike

我想让我的登录界面更漂亮一点。所以我想构建这样的东西:

这就是我必须做到的:

    self.usernameTextField.layer.borderWidth = 1.0f;
self.usernameTextField.layer.borderColor = [[UIColor colorWithRed:171.0/255.0 green:171.0/255.0 blue:171.0/255.0 alpha:1.0] CGColor];
self.usernameTextField.layer.cornerRadius = 5;
self.usernameTextField.clipsToBounds = YES;

self.passwordTextField.layer.borderWidth = 2.0f;
self.passwordTextField.layer.borderColor = [[UIColor colorWithRed:171.0/255.0 green:171.0/255.0 blue:171.0/255.0 alpha:1.0] CGColor];
self.passwordTextField.layer.cornerRadius = 5;
self.passwordTextField.clipsToBounds = YES;

如何连接它们?两个 UITextFields 之间仍然存在间隙..

最佳答案

像你的界面一样放置纯图像背景,并在该图像上放置两个文本字段并设置边界样式,如下所示。

[yourTextField setBorderStyle:UITextBorderStyleNone];

关于ios - UITextField 设置边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19635872/

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