EditText上强调以下text属性 [英] EditText underline below text property

查看:125
本文介绍了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 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):

  1. 转到您的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.

    这篇关于EditText上强调以下text属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆