android-actionbar

How to set the ActionBar title in middle instead of the default left aligned position?

感情迁移 提交于 2020-01-27 08:44:46
问题 Trying to set the ActionBar title in middle instead of the default left aligned position. To do so, based on other answers this is what I've done: Toolbar myToolbar = (Toolbar) findViewById(R.id.toolbarDownloads); setSupportActionBar(myToolbar); if(getSupportActionBar()!=null) { getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); getSupportActionBar().setCustomView(R.layout.actionbar_layout); } actionbar_layout.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout

Android show back button depending on backstack count

不想你离开。 提交于 2020-01-26 04:27:29
问题 I want to show or hide the back button of the action bar depending on the current backstack entry count. That means I want to show it when there is a fragment (or more) in the backstack, and hide when backstack is empty getSupportActionBar().setDisplayHomeAsUpEnabled(b); The problem is, when I start a new fragment and ask for the current backstack entry count, it's still the same like before. It refreshes after some milliseconds. Also in the started fragment's onResume method, the replaced

Android show back button depending on backstack count

馋奶兔 提交于 2020-01-26 04:27:13
问题 I want to show or hide the back button of the action bar depending on the current backstack entry count. That means I want to show it when there is a fragment (or more) in the backstack, and hide when backstack is empty getSupportActionBar().setDisplayHomeAsUpEnabled(b); The problem is, when I start a new fragment and ask for the current backstack entry count, it's still the same like before. It refreshes after some milliseconds. Also in the started fragment's onResume method, the replaced

How to disable the sliding of menu of Action bar in xamarin forms?

一曲冷凌霜 提交于 2020-01-24 19:57:08
问题 I am using MasterDetailPage and using Action Bar in it. I have disabled and hide logo, icon and back button of action bar. But when I try to swipe from left to right from left side a blank menu list opens. I don't know why it is happening. how I can disable this one for action bar. I don't want menu list that's why I disabled back button, icon. How I can disable this sliding menu which is coming from left to right when I am swiping from left to right? 回答1: On the MasterDetailPage there is a

Lollipop Theme issue

吃可爱长大的小学妹 提交于 2020-01-24 11:44:45
问题 I am using sherlock action bar in my project, I have used Theme.Sherlock.Light.DarkActionBar <style name="AppTheme" parent="Theme.Sherlock.Light.DarkActionBar"> <item name="android:homeAsUpIndicator">@drawable/transparent</item> <item name="homeAsUpIndicator">@drawable/transparent</item> <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:titleTextStyle">@style/Widget.MyTheme

Lollipop Theme issue

情到浓时终转凉″ 提交于 2020-01-24 11:43:38
问题 I am using sherlock action bar in my project, I have used Theme.Sherlock.Light.DarkActionBar <style name="AppTheme" parent="Theme.Sherlock.Light.DarkActionBar"> <item name="android:homeAsUpIndicator">@drawable/transparent</item> <item name="homeAsUpIndicator">@drawable/transparent</item> <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:titleTextStyle">@style/Widget.MyTheme

Lollipop Theme issue

ぃ、小莉子 提交于 2020-01-24 11:43:28
问题 I am using sherlock action bar in my project, I have used Theme.Sherlock.Light.DarkActionBar <style name="AppTheme" parent="Theme.Sherlock.Light.DarkActionBar"> <item name="android:homeAsUpIndicator">@drawable/transparent</item> <item name="homeAsUpIndicator">@drawable/transparent</item> <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:titleTextStyle">@style/Widget.MyTheme

Lollipop Theme issue

走远了吗. 提交于 2020-01-24 11:43:25
问题 I am using sherlock action bar in my project, I have used Theme.Sherlock.Light.DarkActionBar <style name="AppTheme" parent="Theme.Sherlock.Light.DarkActionBar"> <item name="android:homeAsUpIndicator">@drawable/transparent</item> <item name="homeAsUpIndicator">@drawable/transparent</item> <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:actionBarStyle">@style/Widget.MyTheme.ActionBar</item> <item name="android:titleTextStyle">@style/Widget.MyTheme

Setting Navigation Icon on Android ActionBar

拟墨画扇 提交于 2020-01-24 05:41:04
问题 So I'm working on adding ActionBarSherlock and the Navigation Drawer to a project that previously implemented a custom (very poorly written) "action bar". Instead of using fragments and a backstack of activities for navigation, some activities show and hide different layouts. (That is, suppose I am in a list mode and then select a button to go into an edit screen. The app currently hides the list layout and shows another layout.). So I've added actionbar sherlock and a navigation drawer to

How to make toolbar with rounded corners and elevation inside appbarlayout? Like this picture

喜欢而已 提交于 2020-01-24 04:34:06
问题 This is my code that I try to create toolbar with rounded corners shown in picture. <android.support.design.widget.AppBarLayout android:id="@+id/appBar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="12dp" android:background="@android:color/transparent"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bg_actionbar" /> </android