有背景的EditText问题(机器人) [英] Problem with EditText background (android)
问题描述
我有背景的EditText像这样
I have a problem with EditText background like this
<EditText
android:id="@+id/edit"
android:layout_width="fill_parent"
android:layout_height="35sp"
android:singleLine="true"
android:layout_marginLeft="5px"
android:layout_marginRight="5px"
android:layout_marginTop="5px"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
在尝试设置的背景下,它看起来更糟
After try to set the background, It look worse
<EditText
android:id="@+id/edit"
android:layout_width="fill_parent"
android:layout_height="35sp"
android:singleLine="true"
android:layout_marginLeft="5px"
android:layout_marginRight="5px"
android:layout_marginTop="5px"
android:textAppearance="?android:attr/textAppearanceSmall"
android:background="#ffffff"
/>
什么是发生在后台的EditText?如何使EditText上保持默认的风格呢?
What's happen with EditText background? How to make EditText keep default style?
推荐答案
如果您设置的EditText背景颜色,你将有效燮preSS Android的默认背景是的大概是九补丁但definetely不只是一个简单的色彩。作为结果 - 你会得到一个简单的EditText的形式 - 一个方盒子。下面是内置的可绘制稍显陈旧名单给你一些想法
If you set your EditText background to a color you will effectively suppress Android's default background which is probably a Nine Patch but definetely not just a simple color. As result - you will get a simplest form of EditText - a square box. Here's slightly outdated list of built-in drawables to give you some idea
这篇关于有背景的EditText问题(机器人)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!