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.

更多相关文章

  1. android window部分属性
  2. Android drawable state各个属性详解
  3. android 视频播放器的INTENT-FILTER属性
  4. RelativeLayout各个属性
  5. textView 和 edittext 的一些属性
  6. 【Android UI控件】EditText属性大全,TextView属性大全

随机推荐

  1. 成为 Java GC 专家( 3 ): 如何优化 Java 垃
  2. 说说 Java 代理模式
  3. 成为 Java GC 专家( 4 ): Apache 的 MaxCli
  4. Lucene 五分钟教程
  5. 在 Java 中如何使用 transient
  6. Lambda 表达式的 10 个示例
  7. 什么是 Java 对象分配率
  8. 一个正则式引发的血案
  9. Java 正则表达式教程及示例
  10. Tomcat 单机多实例部署