V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Registering
V2EX  ›  程序员

android 里 EditText 默认只有底边一条蓝线,如何修改其颜色,像微信是绿色

  •  
  •   Registering · 2014-11-13 23:20:55 +08:00 · 18833 次点击
    这是一个创建于 3452 天前的主题,其中的信息可能已经有所发展或是发生改变。
    找了好一会,没找到方案
    9 条回复    2014-11-15 12:00:20 +08:00
    allan1st
        1
    allan1st  
       2014-11-13 23:28:30 +08:00
    Holo:
    http://android-holo-colors.com

    Material/Appcompat:
    v21
    <item name="android:colorPrimary">@color/black</item>
    <item name="android:colorPrimaryDark">@color/real_black</item>
    <item name="android:colorControlActivated">@color/real_black</item>
    appcompat
    <item name="colorPrimary">@color/black</item>
    <item name="colorPrimaryDark">@color/real_black</item>
    <item name="colorControlActivated">@color/real_black</item>
    不过 material 不支持 AutoCompleteTextView, Spinner 没有下划线都要自己画,也是醉了
    Registering
        2
    Registering  
    OP
       2014-11-13 23:31:33 +08:00
    @allan1st 刚在stackoverflow看到有人这样回答

    正在打开网址,天啊,这网速,,,
    allan1st
        3
    allan1st  
       2014-11-13 23:37:13 +08:00
    @Registering 不要用那个 holo 网站了,拥抱 material 吧:)
    Registering
        4
    Registering  
    OP
       2014-11-13 23:52:31 +08:00
    @allan1st 但是现在开发的app,版本不可能到那么高上去啊,毕竟很多手机不支持material,,,正准备周末学学它呢
    Registering
        5
    Registering  
    OP
       2014-11-13 23:52:39 +08:00
    @allan1st 搞定了
    allan1st
        6
    allan1st  
       2014-11-14 00:11:07 +08:00
    @Registering Support Library v7 最低支持版本是 Api Level 7, 也就是 Android 2.1
    porrat
        7
    porrat  
       2014-11-14 10:07:20 +08:00
    上面的不要误导人,直接设置TextView的android:background就可以了
    allan1st
        8
    allan1st  
       2014-11-14 21:58:38 +08:00
    @porrat 你说的是这种效果?http://i.stack.imgur.com/YaijZ.png
    Registering
        9
    Registering  
    OP
       2014-11-15 12:00:20 +08:00
    @porrat 他给的答案正是我想要的,哈哈
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2682 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 02:01 · PVG 10:01 · LAX 19:01 · JFK 22:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.