android-actionbar

Removing Extra Space in Custom ActionBar

笑着哭i 提交于 2019-12-22 07:56:27
问题 My issue concerns using fully custom ActionBar views (as it's necessary for how my customer wants the ActionBar to work). I've removed the logo, title, and everything else possible. However, the custom view for the ActionBar will not extend all the way across the screen. I've tried the following (as a quick overview): Dynamically removing aspects of the ActionBar (snippet below) Removing the Options Menu in its entirety Specifying in the Style/Theme to remove everything from the ActionBar

Custom layout with ActionBar in appcompat causes content to overlap with action bar

独自空忆成欢 提交于 2019-12-22 07:39:27
问题 I have implemented a custom action bar layout with AppCompat : public class DoneBarActivity { public interface OnSaveActionListener { public void onSave(); } public static void setupActionBar(final ActionBarActivity activity, final OnSaveActionListener listener) { // Inflate a "Done/Cancel" custom action bar view. final LayoutInflater inflater = (LayoutInflater) activity .getSupportActionBar().getThemedContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); final View

how can i show icon app in Lollipop Toolbar?

大城市里の小女人 提交于 2019-12-22 06:38:14
问题 I am missing an app icon after switching from ICS ActionBar to Lollipop toolbar . Is it possible? Please help me. Thanks mDrawerToggle.setDrawerIndicatorEnabled(false); 回答1: The use of application icon and a title is discouraged on API 21,according to Material Design. Anyway if you want to use an icon, you can use the setLogo method in your Toolbar. 来源: https://stackoverflow.com/questions/27768109/how-can-i-show-icon-app-in-lollipop-toolbar

How to go to previous selected tab when pressing an activity action bar back button

六月ゝ 毕业季﹏ 提交于 2019-12-22 05:49:26
问题 I have six Tabs in MainActivity, the second tab have a listview, when user press on the listview item, its open a new Activity with Action bar, so, when user press on the back button of the second activity, I want to go to previous tab (second tab) of Main Activity, but its loading the First Tab (Home Tab). How I can resolve this problem? 回答1: We have three cases here. The actual back button (regardless it is hardware or software), the Action Bar's parent ("Up") button, and both buttons: Back

Android Tab Action Bar

可紊 提交于 2019-12-22 05:15:35
问题 I am trying out on the android action bar for 3.0, where I refer to http://www.youtube.com/watch?v=gMu8XhxUBl8 The code in the TabsActivity are as follow: package com.test.actionbar; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.app.Fragment; import android.app.FragmentTransaction; import android.os.Bundle; public class TabsActivity extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

What is the ID of the back arrow drawable in the ActionBar?

馋奶兔 提交于 2019-12-22 04:59:32
问题 The following code causes a back arrow to appear in the ActionBar: getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); I'm looking for the resource ID of the arrow drawable, i.e. android.R.drawable.xxx. The reason I need this ID is so that I can manually set an identical arrow (size & colour) elsewhere in my app. I tried making my own drawable and using that but the size was different from the one in the ActionBar. 回答1: If you have the

getActionBar from Fragment with AppCompatLibrary

那年仲夏 提交于 2019-12-22 04:42:27
问题 I'm look for the easiest way to get an ActionBar instance from a Fragment using AppCompatLibrary and API 8. Already tried things like getActivity().getSupportActionBar() but no luck. 回答1: Try to cast it: ((YourActivity)getActivity()).getSupportActionBar() 来源: https://stackoverflow.com/questions/17954471/getactionbar-from-fragment-with-appcompatlibrary

Remove ActionBar subtitle / Reset ActionBar text

会有一股神秘感。 提交于 2019-12-22 04:22:05
问题 I'm currently setting the ActionBar subtitle on certain pages, but on some pages i don't want to have a subtitle. I can simply set the text of the subtitle to nothing, but this just removes the text. It still occupies the subtitle space and thus pushes the title up. It can be hard to explain, so i illustrated with a picture: 1) This show the ActionBar with no subtitle set, which is how i want to be able to set it. 2 This shows the ActionBar with a subtitle set, which is how i want to show it

Remove ActionBar subtitle / Reset ActionBar text

▼魔方 西西 提交于 2019-12-22 04:21:15
问题 I'm currently setting the ActionBar subtitle on certain pages, but on some pages i don't want to have a subtitle. I can simply set the text of the subtitle to nothing, but this just removes the text. It still occupies the subtitle space and thus pushes the title up. It can be hard to explain, so i illustrated with a picture: 1) This show the ActionBar with no subtitle set, which is how i want to be able to set it. 2 This shows the ActionBar with a subtitle set, which is how i want to show it

Blank title in action bar

和自甴很熟 提交于 2019-12-22 03:57:02
问题 Is it possible to remove title bar which I think is ugly and doesn't fit in my application but still use actionbar? After I call requestWindowFeature(Window.FEATURE_NO_TITLE | Window.FEATURE_ACTION_BAR); the title bar stays but piece of my view is gone(cant scroll up) Is it possible to get rid of title bar but still keep actionbar, if I dont request it as window feature getActionBar() returns null everytime.. 回答1: Following Honeycomb, Action Bar was introduced to provide more functionalities,