霍洛的位置集中按钮绘 [英] Location of Holo focused Button drawable
问题描述
有谁知道什么是全息主题的位置集中按钮绘制?
我想将它设置为我的一些事件查看,但我无法找到它。
Does anyone know what is the location of Holo theme focused button drawable?
I would like to set it to my View on some event, but I can't find it.
推荐答案
1。首先找到以下在Android SDK中的平台文件夹位置 -
1.first locate following location in your android sdk platforms folder -
yourandroidsdkrootfolderpath \\ \\平台Android的11 \\ DATA \\水库\\绘制结果
(例如:D:\\机器人\\ \\平台Android的11 \\ DATA \\水库\\绘制)
yourandroidsdkrootfolderpath\platforms\android-11\data\res\drawable
(ex:D:\android\platforms\android-11\data\res\drawable)
2.find命名为上文件夹中的XML文件中的 btn_default_holo_dark.xml
而且它含有类似下面code:
2.find the xml file on folder named as btn_default_holo_dark.xml and it's contain like below code:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_window_focused="false" android:state_enabled="true"
android:drawable="@drawable/btn_default_normal_holo_dark" />
<item android:state_window_focused="false" android:state_enabled="false"
android:drawable="@drawable/btn_default_normal_disable_holo_dark" />
<item android:state_pressed="true"
android:drawable="@drawable/btn_default_pressed_holo_dark" />
<item android:state_focused="true" android:state_enabled="true"
android:drawable="@drawable/btn_default_selected_holo_dark" />
<item android:state_enabled="true"
android:drawable="@drawable/btn_default_normal_holo_dark" />
<item android:state_focused="true"
android:drawable="@drawable/btn_default_normal_disable_focused_holo_dark" />
<item
android:drawable="@drawable/btn_default_normal_disable_holo_dark" />
</selector>
3.复印XML到项目的绘制文件夹
4.copy绘制,华电国际,绘制,LDPI,上面的XML提到像
4.copy drawable-hdpi,drawable-ldpi,drawable-mdpi images mentioned above xml like
btn_default_normal,btn_default_normal_disable,btn_default_$p$pssed,btn_default_selected,btn_default_normal,btn_default_normal_disable_focused,btn_default_normal_disable
5.add风格您的 style.xml 文件中像下面
5.add style to your style.xml file like below
<style name="Custombutton" parent="Widget.Button">
<item name="android:background">@android:drawable/btn_default_holo_dark</item>
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:textColor">@android:color/primary_text_holo_dark</item>
<item name="android:minHeight">48dip</item>
<item name="android:minWidth">64dip</item>
</style>
7.适用您的按钮样式像下面code:
6.apply your button style like below code:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
style="@style/Custombutton"
android:layout_height="wrap_content"
android:text="Button" />
这篇关于霍洛的位置集中按钮绘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!