gpt4 book ai didi

android - 更改背景android标题栏

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:06:36 25 4
gpt4 key购买 nike

我知道有人问过这个问题,但我不知道如何让它发挥作用。我想更改标题栏的背景。

我不想更改有关我的申请风格或背景的任何其他内容。

我关注了这个网站上的各种帖子,但似乎没有一个能给出令人满意的结果。

我认为它会像设置一样简单

<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowTitleBackgroundStyle">@drawable/backrepeat</item>
</style>

在 styles.xml 中

然而,这并没有带来任何改变。

为了完整起见,下面是我的 backrepeat 文件

<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg_diamonds"
android:tileMode="repeat"
android:dither="true"
/>

以及manifest.xml中的代码

<application
android:allowBackup="true"
android:icon="@drawable/maxmm_start_icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >

最佳答案

您可以在 Activity 创建时使用它。 (创建时)

ActionBar bar = getActionBar();
//for color
bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00C4CD")));
//for image
bar.setBackgroundDrawable(getResources().getDrawable(R.drawable.settings_icon));

关于android - 更改背景android标题栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19112099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com