ios - 我怎样才能使我的 uitextfield 看起来像塌陷?

标签 ios swift uitextfield

如何使我的 uitextfield 在图片中看起来像塌陷?我相信这就是所谓的插图?我怎样才能做到这一点?

enter image description here

最佳答案

默认情况下,您可以将 BorderStyle 属性设置为 Bezel as

myTextField.borderStyle = UITextBorderStyle.Bezel
myTextField.layer.cornerRadius = 5
myTextField.backgroundColor = UIColor.lightGrayColor() //Any Color you want

但是如果你想给出图片显示的效果,你需要自定义UITextField

关于ios - 我怎样才能使我的 uitextfield 看起来像塌陷?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38220390/

相关文章:

ios - 每小时运行一次 OAuth URLRequest? - swift

ios - 下一步按钮将焦点带到下一个 UITextField?

ios - Firebase数据库swift的权限被拒绝

ios - 我如何测试游戏中心

ios - UIView center 属性给出了意想不到的结果

ios - 在 Xcode 项目中添加 Carthage 的最快方法

objective-c - 在 Swift 中公开 Objective C 类扩展属性

ios - View 中有多个圆角

ios - 第二次点击 UITextField(在 UITableViewCell 子类中)意外地关闭键盘

ios - swift 4、设置textField localizedString占位符颜色