在混合主题全息光与暗全息的EditText [英] Mixing holo light and holo dark EditText in theme

查看:232
本文介绍了在混合主题全息光与暗全息的EditText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用全息暗我的应用程序的主题。但是,它的一部分,我想从全息光使用的EditText 作为背景光这一部分。我曾尝试在主题做当我做了一个按钮,类似它的工作(我们想用姜饼样式按钮):

I am using Holo dark as the theme of my app. However, there is part of it where I wish to use the EditText from holo light as the background is light in this part. I have tried doing it in themes. It worked when I did something similar for a button (we wanted to use the gingerbread style button):

<style 
       name="Theme.Banks" parent="Theme.Sherlock.ForceOverflow">
       <item name="android:buttonStyle">@android:style/Widget.Button</item>
</style>

我试图做同样与Android:editTextStyle,但它不会影响绘制。由所述属性机器人处理:editTextBackground。展望code,我不能只覆盖此,并在光点的主题,因为它引用了一个私人绘制:

I tried doing the same with android:editTextStyle, but it does not affect the drawable. That is handled by the attribute android:editTextBackground. Looking into the code, I cannot just override this and point it at the light theme because it references a private drawable:

这是从SDK的themes.xml:

This is from themes.xml in the SDK:

<item name="editTextBackground">@android:drawable/edit_text_holo_dark</item>

所以我的问题是如何做到这一点?

So my question is how to do this?

另一个用例可能是希望从姜饼使用的EditText。

Another use case might be wishing to use the EditText from gingerbread.

任何想法?

推荐答案

您可以抓取,你需要走出的SDK res文件夹中,包括他们自己的项目中可绘制然后引用自己的全息光绘项目的副本一个EditText上。

You could grab the drawables that you need out of the the sdk res folder and include them with your own project then reference your own copy of the holo light drawables for that one EditText.

似乎效率不高,但我不知道任何其他方式来解决你的风格问题。

Seems inefficient, but I am not sure of any other way to get around your style issue.

这篇关于在混合主题全息光与暗全息的EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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