简体   繁体   English

如何从默认的UITextField中删除“border-radius”?

[英]How to remove “border-radius” from default UITextField?

My question is, how do I remove the " border-radius " of the textfield in Swift? 我的问题是,如何删除Swift中文本textfield的“ border-radius ”? Is it achievable in xCode or do you need to do a customized textfield ? 是在xCode中可以实现还是需要自定义textfield If so, how do I do that? 如果是这样,我该怎么做? I want the default textfield but without it's " border-radius " if you know what I mean. 如果你知道我的意思,我想要默认的textfield但没有它的“ border-radius ”。

Help, please! 请帮助!

What do you exactly mean with border-radius? 你对border-radius意味着什么? the border around it? 它周围的边界? You can turn that off by clicking the button in xcode: 您可以通过单击xcode中的按钮将其关闭:

在此输入图像描述

Or if you want to do it programmatically do: 或者,如果您想以编程方式执行此操作:

myButton.bordered = false

You can set the border style using Storyboards. 您可以使用Storyboard设置边框样式。

在此输入图像描述

And also you can set border style programitically 而且你也可以设置边框样式

[txtUserName setBorderStyle:UITextBorderStyleNone];

UITextField has an attribute borderStyle , which can be changed either in interface builder: UITextField有一个属性borderStyle ,可以在界面构建器中更改:

UITextField有一个属性borderStyle,可以更改。

...or in code: ......或代码:

public var borderStyle: UITextBorderStyle // default is UITextBorderStyleNone. If set to UITextBorderStyleRoundedRect, custom background images are ignored.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM