android edittext 去边框 去下划线

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.

时间: 2024-10-09 13:58:37

android edittext 去边框 去下划线的相关文章

去链接的下划线

<p style ="padding-left: 35px;padding-top: 6px;"><%=link_to(t('mypage.live_order_btn'), {:action => "course_order",:id => course.id, :back_action =>params[:action]},:style=>"color:white;font-weight: bold;text-

android textView 替文字添加下划线 删除线

android textView 为文字添加下划线 删除线android textview 添加下划线 中划线 删除线tv=(TextView)findViewById(R.id.tvId);tv.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG); //删除线//Paint.UNDERLINE_TEXT_FLAG 下划线 XAMARIN: TextView text = FindViewById<TextView>(Resource.Id.xxx

android ------ 高版本的 Tablayout 下划线宽度

前面呢,有写过TabLayout的博客,最近开发用到了高本版遇到一些问题,来总结一下 Android--------TabLayout实现新闻客户端顶部导航栏 Android中Tablayout设置下划线宽度 和 dp和px之间进行相互转换 上面是Api28版本之前是没问题的 api28之后呢,有些地方就有所改变了 public static void reflex(final TabLayout tabLayout){ tabLayout.post(() -> { try { //拿到tabL

Android开发之TextView的下划线添加

如何给TextView添加下划线呢,最近项目中需要这个,于是就用代码添加了下划线功能.主要就是用Paint的setFlags方法来实现,具体如下: ((TextView)mScrollView.findViewById(R.id.refresh)).getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); 就是获取TextView,然后获取Paint,再用Paint提供的setFlags方法设置下划线,该方法还可以设置其他的属性,比如颜色等

android:为TextView添加样式——下划线,颜色,设置链接样式及前背景色

实现下划线及颜色设置: public class AtActivity extends Activity { LinearLayout ll; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); l

delphi edit边框成为下划线

设置它的几个属性:BevelEdges    |_ beLeft = False;    |_ beTop   = False;    |_ beRight = False;    |_ beBottom=True;   //就是下面那根横线了 BevelInner=bvNone;BevelKind =bkSoft;BevelOuter=bvRaised;BorderStyle=bsNone;ParentColor=True; 原文地址:https://www.cnblogs.com/semth

Android之自定义EditText光标和下划线颜色

"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Android之自定义EditText光标和下划线颜色 - Lindroid的博客 - 博客频道 - CSDN.NET Lindroid的博客 不积跬步,无以至千里. 目录视图 摘要视图 订阅 [活动]2017 CSDN博客专栏评选 &nbsp [5月书讯]流畅的Py

“layout_”下划线开头的属性

观看幕课网的视频的收获 “layout_”下划线开头的属性都是交给父容器去处理的属性,如: android:layout_width="match_parent" android:layout_height="match_parent" 没有layout_”下划线开头的属性都是本身的属性,如: android:background="#00ff00" android:visibility="gone"

android-TimePickerDialog 下划线颜色修改

首先就是去framework下去找与之相关的theme属性 最开始的时候,直接找的是<item name="datePickerStyle">@style/Widget.Funui.DatePicker</item> ,但是,往父类里面找的话,并没有找到有效属性,仅仅就有一个布局 <item name="android:internalLayout">@android:layout/date_picker_holo</ite