我将自己的应用从自定义标题栏切换到ActionBar支持库,因为我喜欢ActionBar提供的功能,而且之前我仅仅因为3.0+而避免了它。我有ActionBar正常工作,这是很好的,但我的应用程序也有一个较低的酒吧在屏幕的底部,我想保持与顶部的ActionBar相同的外观。由于它看起来像ActionBar使用图像背景(九个补丁PNG),而不是像我以前所做的那样定义颜色,所以我需要从我的布局xml访问可拖动的操作栏底部的drawable,并将其用作底部栏的背景。Android主题:如何从AndroidManifest.xml中选择的主题引用drawable?
我查看了支持v7库,发现了drawable/abc_cab_background_bottom_holo_dark和手动输入,可以很好地处理黑暗的主题。不过,我想放入一些能够自动为AndroidManifest中指定的主题提取正确的drawable的东西,无论是明亮还是黑暗的主题。
这里是XML的问题位:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="@drawable/abc_ab_bottom_solid_light_holo">
,并在AndroidManifest.xml:
<application android:icon="@drawable/icon"
android:allowBackup="true"
android:label="@string/app_name"
android:hardwareAccelerated="true"
android:theme="@style/Theme.AppCompat.Light" >
一切我已经找到了一直在讨论如何与自己的主题编辑动作条,但我想做相反的事情,根据股票appcompat主题编辑我自己的股票,股票的ActionBar可绘制。具体而言,做什么,我把为Android:背景=参考的当前主题的版本:
<item name="actionModeSplitBackground">@drawable/abc_cab_background_bottom_holo_dark</item>
为V7 /程序兼容性/ RES /价值/ themes_base.xml界定?
哪里是R. drawable.bg_striped_split定义了吗? – CalcProgrammer1
Just Edited .. !!并请告诉我,如果它的工作与否.. :) – arraystack