android edittext 去边框 去下划线
16lz
2021-01-23
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:
<EditText android :id="@+id/title" android :layout_width="fill_parent"
style="? android :attr/textViewStyle"
android :background="@null" android :textColor="@null"/>
Instead of style="? android :attr/textViewStyle" you can also write style=" @ android :style/Widget.TextView", don't ask me why and what it means.
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:
<EditText android :id="@+id/title" android :layout_width="fill_parent"
style="? android :attr/textViewStyle"
android :background="@null" android :textColor="@null"/>
Instead of style="? android :attr/textViewStyle" you can also write style=" @ android :style/Widget.TextView", don't ask me why and what it means.
更多相关文章
- android开发--RelativeLayout用到的一些重要的属性
- [转] 软键盘android:windowSoftInputMode属性使用
- Android_布局属性大全
- android shape 常用到属性的设置
- android学习——android text 属性大全
- Android EditView属性详细介绍
- Android studio相对布局的常用属性
- android中Selector中的相关属性及配置写法