android edittext 去边框 去下划线,android edittext 去边框 去下划线

在Android中,去除EditText的边框和下划线可以通过设置android:background="@null"来实现。此外,可以使用style="?android:attr/textViewStyle"或者style="@android:style/Widget.TextView"来进一步调整样式。通过这种方式,EditText可以达到无边框无下划线的效果。
摘要由CSDN通过智能技术生成

EditText的background属性设置为@null就搞定了:android:background="@null"

style属性倒是可加可不加

附原文:

@SlumberMachine, that's a great observation! But, it seems that there is more to making a TextView editable than just setting android:editable="true". It has to do with the "input method" - what ever that is - and that is where the real difference between TextView and EditText lies. TextView was designed with an EditText in mind, that's for sure. One would have to look at the EditText source code and probably EditText style to see what's really going on there. Documentation is simply not enough.

I have asked the same question back at android-developers group, and got a satisfactory answer. This is what you have to do:

XML:

style="?android:attr/textViewStyle"

android:background="@null" android:textColor&#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值