android-actionbar

Android: Icons don't appear in Action Bar

和自甴很熟 提交于 2020-01-13 17:57:11
问题 I'm following the google tutorial for action bars but the icons don't appear on it, this is the menu xml file: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:yourapp="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_refresh" android:icon="@drawable/ic_action_refresh" android:title="refresh" android:showAsAction="ifRoom"/> <item android:id="@+id/action_settings" android:icon="@drawable/ic_action_settings" android:title="settings" android

Android ActionBar pattern - multiple activities or fragments

最后都变了- 提交于 2020-01-13 06:04:39
问题 There are few similar questions on stackoverlow, but I haven't find clear explanation at any of the answers how to implement Action Bar pattern for more complex/multiple activities apps. As I understand, there are two options to do this: 1.) implement multiple activities and in each of them implement/include action bar --> problem with this is that when ever you lunch new activity, although it has the same looking action bar, it has that transition, and jumps through the screen, so it's

Android ActionBar pattern - multiple activities or fragments

时光毁灭记忆、已成空白 提交于 2020-01-13 06:04:18
问题 There are few similar questions on stackoverlow, but I haven't find clear explanation at any of the answers how to implement Action Bar pattern for more complex/multiple activities apps. As I understand, there are two options to do this: 1.) implement multiple activities and in each of them implement/include action bar --> problem with this is that when ever you lunch new activity, although it has the same looking action bar, it has that transition, and jumps through the screen, so it's

android webview: prevent text selection actionMode actionBar

你离开我真会死。 提交于 2020-01-12 18:43:39
问题 I want to preserve the text selection in a webView while preventing any contextual menu of the actioMode from being shown. Neither the new floating one nor the old actionBar, just the selection handles and of course the selection behaviour. Hooking to the actionModeCallback in startActionMode allows me to clear all items in the menu in the callback onCreateActionMode. This works fine on android 6, since an empty floating menu won't show at all, and the actionMode text selection behaviour is

Actionbar with Fragment tabs and AdMob

岁酱吖の 提交于 2020-01-12 10:22:33
问题 I have an app that uses the ActionBar with tabs in combination with Fragments. Now I would like to separate the screen into the normal screen at the top, and a small bar at the bottom for the ads: Left is the normal screen, the tabs and their Fragments take up the whole screen. What I want is the situation on the right. The tabs and Fragments take up the red part, the green part is for ads. So the red part should make room for the ads, I don't want to overlay the ads. As the Activity which

Android Espresso typeText into EditText in ActionBar

梦想的初衷 提交于 2020-01-12 10:06:05
问题 I have a SearchView in my ActionBar that is inflated from XML <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/action_menu_search" android:showAsAction="always|collapseActionView" android:icon="@drawable/action_bar_search_icon" android:actionViewClass="android.widget.SearchView"/> </menu> I inflate it in my Fragment this way: @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater

Android Espresso typeText into EditText in ActionBar

空扰寡人 提交于 2020-01-12 10:05:08
问题 I have a SearchView in my ActionBar that is inflated from XML <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/action_menu_search" android:showAsAction="always|collapseActionView" android:icon="@drawable/action_bar_search_icon" android:actionViewClass="android.widget.SearchView"/> </menu> I inflate it in my Fragment this way: @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater

Android Espresso typeText into EditText in ActionBar

时光怂恿深爱的人放手 提交于 2020-01-12 10:03:06
问题 I have a SearchView in my ActionBar that is inflated from XML <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/action_menu_search" android:showAsAction="always|collapseActionView" android:icon="@drawable/action_bar_search_icon" android:actionViewClass="android.widget.SearchView"/> </menu> I inflate it in my Fragment this way: @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater

Center position of logo in Action Bar Android

烂漫一生 提交于 2020-01-12 07:56:12
问题 I want to display the logo at the centre of the Action Bar. Here's my custom layout code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ActionBarWrapper" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="horizontal"> <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/logo" android:layout

Actionbar convert tabs to list navigation if there is no room

给你一囗甜甜゛ 提交于 2020-01-12 07:37:08
问题 I have an actionbar with a logo, a title, 2 tabs and a search function. On a phone (3.5") everything works fine. The actionbar has 2 lines. The logo title and the search function appear on the first line and the tabs apear on the second line. On my tablet (7") everyting is shown on a single line. But the tabs will be convert to a list when i click the search icon. How can i split the (sherlock)actionbar in 2 lines on my 7" tabblet? Or is there an other way to solve this problem? 回答1: In