android-theme

Full Screen Theme for AppCompat

久未见 提交于 2019-11-26 00:45:25
问题 I would like to know how can I apply full screen theme ( no title bar + no actionbar ) to an activity. I am using AppCompat library from support package v7. I\'ve tried to applied android:theme=\"@android:style/Theme.NoTitleBar.Fullscreen\" to my specific activity but it crashed. I think it\'s because my application theme is like this. <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\"> I also have tried this getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN

How to change the background color of Action Bar&#39;s Option Menu in Android 4.2?

徘徊边缘 提交于 2019-11-26 00:22:21
问题 I\'d like to change the background color of the option (overflow) menu in Android 4.2. I have tried all the methods but it is still showing the default color set by the theme. I used the following code & XML configs. MainActivity.java public class MainActivity extends Activity { @SuppressLint(\"NewApi\") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getActionBar().setIcon(R.drawable.ic_launcher);

Can&#39;t Find Theme.AppCompat.Light for New Android ActionBar Support

北战南征 提交于 2019-11-25 23:24:13
问题 I am trying to implement the new ActionBar support library that was released by Google a couple days ago. In the past, I have successfully implemented ActionBarSherlock without any issues using the same method listed on Google Developer\'s Support Library Setup page - using the guide on how to include the resources (which is similar to how ActionBarSherlock did it). I have the library project loaded in to my own project as a library as well. I can tell the library is loading fine. When,

Android toolbar center title and custom font

岁酱吖の 提交于 2019-11-25 22:41:25
问题 I\'m trying to figure out the right way to use a custom font for the toolbar title, and center it in the toolbar (client requirement). At the moment, i\'m using the good old ActionBar, and I was setting the title to empty value, and using setCustomView to put my custom font TextView and center it using ActionBar.LayoutParams. Is there a better way to do that? Using the new Toolbar as my ActionBar. 回答1: To use a custom title in your Toolbar all you need to do is remember is that Toolbar is

How do I change the background color of the ActionBar of an ActionBarActivity using XML?

人走茶凉 提交于 2019-11-25 21:58:40
问题 Details: I\'m extending ActionBarActivity. Eclipse and SDK fully patched as of 2011-11-06. <uses-sdk android:minSdkVersion=\"4\" android:targetSdkVersion=\"14\" /> Deployed to Samsung device with Android 2.3.3 Application has android:theme=\"@android:style/Theme.Light\" Issue: application is light, but ActionBar is blue with grey icons, hardly visible against the blue background color. I also want the ActionBar to be light, so they grey icons are more visible. I\'ve tried modifying the styles

How to center align the ActionBar title in Android?

心不动则不痛 提交于 2019-11-25 20:43:23
I am trying to use the following code to center the text in the ActionBar , but it aligns itself to the left. How do you make it appear in the center? ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setTitle("Canteen Home"); actionBar.setHomeButtonEnabled(true); actionBar.setIcon(R.drawable.back); Ahmad To have a centered title in ABS (if you want to have this in the default ActionBar , just remove the "support" in the method names), you could just do this: In your Activity, in your onCreate() method: getSupportActionBar().setDisplayOptions(ActionBar