android-actionbar

ShareActionProvider with one icon - looking as simple actionitem

不打扰是莪最后的温柔 提交于 2019-12-10 14:54:58
问题 I want to dislay ShareActionProvider on ActionBar , but with custom look&feel. Only one simple share icon without borders and without most used app icon on the right. But providing popup menu with most used applications. Is there a simple way to do it without implementing own ShareActionProvider ? 回答1: OK so regardless of ActionBarSherlock first test to see if your creating your intent correctly, ABS uses the same code as the generic chooser does so see if the app's you are looking for show

Toolbar title textsize decreases on orientation change

﹥>﹥吖頭↗ 提交于 2019-12-10 14:44:54
问题 The Toolbar title textsize gets decreased when I change orientation from portrait to landscape and gets reset when I change back to portrait. The activity in which this happens extends ActionBarActivity which uses getSupportActionBar() . 回答1: Use the below solution: <android.support.v7.widget.Toolbar android:id="@+id/main_toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:titleTextAppearance="@style/ToolbarTitle

Android: Adjusting the position of actionbar overflow menu dropdown

ぐ巨炮叔叔 提交于 2019-12-10 14:41:27
问题 I have an issue with my action bar overflow menu dropdown. It is displayed on top of the action bar itself. I want it to be displayed below the action bar and overflow button. I am using android studio for development. This is my menu <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context="com.xxx.messageapp.MessageActivity" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/menu_overflow" android

Contextual Actionbar with DialogFragment

蓝咒 提交于 2019-12-10 14:15:23
问题 I've been trying to implement a contextual action bar along with a dialog fragment. Similar to the downloads widget in android. I've tried to set android:windowActionModeOverlay to be true in the theme. But it doesnt seem to work. Is there any way I can achieve it?? 回答1: The downloads window that you have in your screenshot is actually an Activity using the @android:style/Theme.Holo.Dialog theme which makes it look like a dialog. To achieve the same look as the downloads window, your Activity

Changing position of Android Action Bar

久未见 提交于 2019-12-10 13:21:27
问题 I am currently changing my android app so that it supports the action bar as stated by the android development guidelines. I've successfully created the action bar and added, what were my menu buttons to the action bar. However, the action bar is being squished up at the top next to the program name icon and instead I want to show the action bar at the bottom of the screen. Is there a way of changing the position of the action bar? I've tried doing a Google search and looking at the dev guide

Menu icon is not displaying in action bar

丶灬走出姿态 提交于 2019-12-10 13:18:50
问题 I need to inflate custom menu in Fragment. I have only one menu item.But the icon is not displaying. Can someone tell what is wrong with my code My menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" > <item android:id="@+id/search" android:icon="@android:drawable/ic_search_category_default" app:showAsAction="always" android:title="Search"/></menu> And I set in onCreateView

Search view close icon appearing disabled rather than white

99封情书 提交于 2019-12-10 12:53:48
问题 Whenever I type into my search view the close button (X) appears to be disabled for some reason rather than appearing in the colour white. How can this error be resolved so that it appears white? @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.menu_search_list, menu); MenuItem item = menu.findItem(R.id.action_search); SearchView searchView = (SearchView) MenuItemCompat.getActionView(item); searchView.setOnQueryTextListener(this);

Action Bar .selectTab() and .setSelectedNavigationItem() not working

社会主义新天地 提交于 2019-12-10 12:23:50
问题 I have an ActionBar with multiple tabs, each linked to a fragment. The problem I have is that when I use either bar.selectTab(Tab) or bar.setSelectedNavigationItem(int) , it doesn't work. Specifically, this problem occurs when the tabs get reduced down to a Spinner in the ActionBar. 回答1: There is a known bug with the ActionBar, specifically with the methods mentioned above and specifically when the ActionBar's tabs are reduced to a Spinner. Here's my workaround. It uses reflection to drill

Android ICS to JB Actionbar tabs changed requirements

陌路散爱 提交于 2019-12-10 12:18:57
问题 I have an application that targets SDK 15, ICS 4.0.3. I just updated it to point at 4.1 it broke my user interface, and makes it pretty ugly: Here's what it looks like normally on API 15: And here's it on 16 or 17: I got a feeling this is because the Nexus 7 uses the phone UI instead of the actual tablet UI... Is there a way to force the tabs into the actionbar without having to use something like ActionBar sherlock or something else (like subclassing)? Or even if I could make the tabs not

How to attach() and detach() instead of add() and remove() to save fragment view

五迷三道 提交于 2019-12-10 11:58:55
问题 I have the following code for ActionBar : private class MyTabListener implements ActionBar.TabListener { private Fragment mFragment; private final Activity mActivity; private final String mFrag; public MyTabListener( Activity activity, String fragName ) { mActivity = activity; mFrag = fragName; } @Override public void onTabReselected( Tab tab, FragmentTransaction ft ) { // TODO Auto-generated method stub } @Override public void onTabSelected( Tab tab, FragmentTransaction ft ) { mFragment =