如何隐藏UITextField边框? [英] How to hide UITextField border?

查看:418
本文介绍了如何隐藏UITextField边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UITextField,并且我试图使UITextField边框不可见,以便背景和UITextField具有相同的颜色,并且具有无缝的外观.但是问题是我也使用了占位符,并且有一个边框无法删除.我已经尝试过:

I have a UITextField and I am trying to make the UITextField border invisible so that the background and UITextField would have the same color and there would be a seamless look. But the problem is I also use a placeholder and there is a border that I cannot remove. I already tried:

textOption.borderStyle = UITextBorderStyleNone;
textOption.layer.borderWidth = 0;

它没有用.您能帮我吗?我仍然可以看到UITextField的边框.仅供参考:我使用的UITextView没有这个问题=> UITextViews中没有占位符.

It didn't work. Would you please help me on that? I still can see the border of the UITextField. fyi: The UITextView that I use doesn't have this issue => There is no placeholder in UITextViews.

推荐答案

如果要删除文本框边框,可以直接使用界面生成器进行操作:

If you want to remove the textfield border you can do it directly with interface builder:

这篇关于如何隐藏UITextField边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆