EditText上强调以下text属性属性、EditText、text

由网友(再痛也要坚持)分享简介:我想改变蓝色下面的编辑文字,我不知道它是什么性质。 I would like to change the blue colour below the edit text, i don't know what property it is. 我试图用不同的背景颜色,但没有奏效。I tried using a dif...

我想改变蓝色下面的编辑文字,我不知道它是什么性质。

I would like to change the blue colour below the edit text, i don't know what property it is.

我试图用不同的背景颜色,但没有奏效。

I tried using a different background colour for it but it didn't work.

我附有图片如下:

推荐答案

您必须使用一个不同的背景图片,不变色,为的的EditText (重点每个状态,启用,激活)。

You have to use a different background image, not color, for each state of the EditText (focus, enabled, activated).

http://android-holo-colors.com/

在上面的网站,你可以从很多组件的全息主题得到的图像。只需选择的EditText和您想要的颜色。你可以看到一个preVIEW在页面的底部。

In the site above, you can get images from a lot of components in the Holo theme. Just select "EditText" and the color you want. You can see a preview at the bottom of the page.

下载的.zip文件,然后复制粘贴资源在您的项目(图像和XML)。

Download the .zip file, and copy paste the resources in your project (images and the XML).

如果你的XML被命名为:apptheme_edit_text_holo_light.xml(或类似):

if your XML is named: apptheme_edit_text_holo_light.xml (or something similar):

转到您的XMLstyles.xml,并添加自定义的的EditText 风格:

<style name="EditTextCustomHolo" parent="android:Widget.EditText">
   <item name="android:background">@drawable/apptheme_edit_text_holo_light</item>
   <item name="android:textColor">#ffffff</item>
</style>

只是这样做在你的的EditText

<EditText
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   style="@style/EditTextCustomHolo"/>

就是这样,我希望它可以帮助你。

And that's it, I hope it helps you.

阅读全文

相关推荐

最新文章