Android Simple way for User Color Selections
How can you change application colors on the fly?
I am currently using the following to change the background: LinearLayout mScreen = (LinearLayout) findViewById(R.id.main); mScreen.setBackgroundColor( mycolor );
I tried to use Style's to change the text using: @co开发者_StackOverflowlor/white
The problem is that Spinners/Buttons and Spinner-Popup-Lists all change to white text as well, making them unreadable. I have over 20 Classes in my app that all need to be able to change color combination's.
One way to do this is to create several themes. To apply a theme at runtime, call setTheme
in your activities' onCreate
methods (before setContentView
). You can force re-creation and thus re-theming of your activity by doing something like:
startActivity(getIntent());
finish();
精彩评论