简体   繁体   English

如何通过Java设置动作栏的夏洛克颜色永久?

[英]How to set Action bar sherlock color permenent through java?

I want to change the ActionBarSherlock color permanently, I tried the following code but, when I reopen the application it resets to the previous color 我想永久更改ActionBarSherlock的颜色,我尝试了以下代码,但是,当我重新打开应用程序时,它将重置为以前的颜色

getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));

My intentions are to make a theme that changes the ActionBarSherlock color with user input 我的意图是制作一个可以通过用户输入更改ActionBarSherlock颜色的主题

First of all, stop using ActionBarSherlock. 首先,停止使用ActionBarSherlock。 Use the AppCompat library provided by Android. 使用Android提供的AppCompat库。

Secondly use ActionBar Style Generator to apply style (color) to the ActionBar 其次,使用ActionBar样式生成器将样式(颜色)应用于ActionBar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM