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.

Here is the thread at android-developers: http://groups.google.rs/group/an ... 22#1ee9a6a2f60fb86e

下载 (55.54 KB)
2010-1-5 18:46

更多相关文章

  1. Android中控件的继承 通用行为和属性
  2. android默认属性
  3. 将Android DHCPInfo 属性转换为int类型(使用BigInteger)
  4. android gravity padding margin 布局属性使用说明

随机推荐

  1. android 中 checkBox 的使用
  2. Android(安卓)深入研究LBS(基于位置的服务
  3. Android:霓虹灯
  4. 三步搞定:Vue.js调用Android原生方法
  5. Android之Loader理解
  6. 修改进度条ProgressBar颜色
  7. 2011.07.11——— android 自定义toast
  8. android -- 框架 使用android快速开发框
  9. Android拦截、监听系统返回键事件
  10. Android(安卓)FFMPEG音视频开发(四)