android-actionbar

how to remove spacing between ActionBar icons

三世轮回 提交于 2019-12-20 04:15:35
问题 Once again I'm fighting with ActionBar styles for SDK 14 and above. I'm trying to remove/reduce spacing between Tab icons since the default spacing does not fit well in my design. Currently my style looks like: <style name="sMain" parent="@android:style/Theme.Holo"> <item name="android:actionBarStyle">@style/mTabAreaBackground</item> <item name="android:actionBarTabStyle">@style/ActionBarTabStyle</item> </style> <style name="mTabAreaBackground" parent="@android:style/Widget.Holo.ActionBar

getSupportActionBar() returns Null in Android app

我们两清 提交于 2019-12-20 03:46:08
问题 I'm trying to make an action with tabs in Android Studio but getSupportActionBar() always returns null. I just want a simple actionbar with 3 tabs where i can click on but neither the actionbar or the tabs are appearing. This is my code : import android.os.Bundle; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.Window; public class MainActivity extends

Action bar with back arrow

帅比萌擦擦* 提交于 2019-12-20 03:24:14
问题 I am making an app and I want to put an action bar with a back arrow in a fragment. So, I already have the fragment with the action bar but don't know how to put the back arrow on it. Can you help me please? Thank you, Guilherme This is the fragment with an action bar tag 回答1: Add following line in your fragment if you want to show the back button from the fragment : ((AppCompatActivity)getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); It would be better that along with

Is possible to increase the size of ActionBarDrawerToggle (Drawer menu)?

↘锁芯ラ 提交于 2019-12-20 03:20:05
问题 I followed ActionBarDrawerToggle GUIDE And I know how to show the icon of drawer on Action Bar by using drawerImageRes in this. public ActionBarDrawerToggle (Activity activity, DrawerLayout drawerLayout, int drawerImageRes, int openDrawerContentDescRes, int closeDrawerContentDescRes) The Activity hosting the drawer drawerLayout The DrawerLayout to link to the given Activity's ActionBar drawerImageRes A Drawable resource to use as the drawer indicator openDrawerContentDescRes A String resource

ActionBarWindow “Unable to resolve static field” [closed]

丶灬走出姿态 提交于 2019-12-20 03:16:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am getting error when I try to run a android application with action bar. VFY: unable to resolve static field 1538 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable; java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable Any help or suggestions are appreciated. 回答1: Are you very

What does ActionBar#setDefaultDisplayHomeAsUpEnabled in Android Support library?

烂漫一生 提交于 2019-12-20 03:08:43
问题 I know what setDisplayHomeAsUpEnabled does, but what is setDefaultDisplayHomeAsUpEnabled for I can only wonder. No documentation found, cannot find anything except it is being used. 回答1: This method is only available in the Support Action Bar, not in the "native" ActionBar class available since Android 3. More importantly, it is annotated with @hide in the source, meaning it is not part of the official API for third-party developers. That is why it is nowhere documented by Google. You should

Reload Fragment

自古美人都是妖i 提交于 2019-12-20 02:59:17
问题 I am just curious, as I have set up Fragment tabs in a FragmentActivity, how to reload a fragment either from the FragmentActivity, or from the Fragment itself, to just purge and reload that tab. I essentially need the same thing that happens when I reselect the tab to happen, when it replaces the fragment. Is there a simple way to do this and reload the fragment ? 回答1: Create a method that begins a FragmentTransaction, detaches the fragment, and commits. Then begin a new FragmentTransaction

How to set action bar title center in navigation drawer?

喜夏-厌秋 提交于 2019-12-20 02:34:36
问题 I am using navigation drawer from this tutorial http://www.androidhive.info/2013/11/android-sliding-menu-using-navigation-drawer/ everything is working fine,but the issue is my title is aligned left side,but i want title of action bar at center,and if i make it custom then i need to make it for all my fragments,so that is what i dont want to implement by using xml,is there any idea about to center title in action bar following is my code MainActivity.java public class MainActivity extends

Android SupportActionBar does not refresh title

随声附和 提交于 2019-12-20 02:15:31
问题 I have a problem with refreshing ActionBar title. The application is rather simple, currently it only have one activity: ` <android.support.design.widget.AppBarLayout android:id="@+id/app_bar" android:layout_width="match_parent" android:layout_height="@dimen/app_bar_height" android:fitsSystemWindows="true" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/toolbar_layout" android:layout_width="match_parent" android:layout

ActionBarCompat menu item is not showing [duplicate]

折月煮酒 提交于 2019-12-20 01:14:26
问题 This question already has answers here : Actionbar not shown with AppCompat (3 answers) Closed 5 years ago . Here is my general.xml file <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/action_settings" android:orderInCategory="100" android:showAsAction="never" android:title="@string/action_settings"/> <item android:id="@+id/next" android:title="Next" android:visible="true" android:enabled="true" android:showAsAction="always" android:orderInCategory="1