android-toolbar

How to make the three dots appear in the Android toolbar

本小妞迷上赌 提交于 2019-12-12 22:20:04
问题 I am new in Android applications development, and I am trying to develop an application in UI I added a toolbar but In don't know why the three dots in the right side of the toolbar, it is necessary for me because I want to add a logout button there. here is the toolbar layout: <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android

How do I customize menu item's background color?

▼魔方 西西 提交于 2019-12-12 20:18:08
问题 I'm trying to customize Toolbar 's popup menu. Now I can not set background color of menu item. My styles.xml looks like this: <resources> <!-- Base application theme. --> <style name="AppTheme.NoActionBar" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <item name="android:actionBarStyle">@style/AppTheme.ActionBar</item> <item name="android:actionMenuTextColor">@color/actionbar_text_color</item> <item name=

Collapsing Toolbar image disappearing when scolling up

给你一囗甜甜゛ 提交于 2019-12-12 18:18:31
问题 I am trying to implement a collapsing toolbar with a large header image. I want the image to start very big (and it works) and not collapse entirely (that works too). The problem is that when the toolbar reaches minimum collapsable height the image disappears, fading to the app's primary color. I want the image to stay visible even when collapsed. Also, the back button is scolling up along with the picture, and I want it to keep fixed in place. The activity's xml: <android.support.design

My Toolbar is not shown on API level 19 (Kitkat) while it is shown for API level 21

牧云@^-^@ 提交于 2019-12-12 16:08:08
问题 My Code is not showing the Toolbar on Kitkat . Here is my ScreenShot for both the version of Android. Kitkat version: Lollipop version: What might be the reason behind this. Manifest File <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.global.market"> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <application android:allowBackup=

CollapsingToolbarLayout: Keep Toolbar but hide TabLayout with quick return

淺唱寂寞╮ 提交于 2019-12-12 14:22:31
问题 I want the Toolbar to always be visible and have the TabLayout get scrolled away and quick return but this combination seems impossible. <CoordinatorLayout> <AppBarLayout> <CollapsingToolbarLayout layout_scrollFlags="scroll|exitUntilCollapsed"> <TabLayout/> <Toolbar layout_collapseMode="pin" /> </CollapsingToolbarLayout> </AppBarLayout> <ViewPager/> </CoordinatorLayout> This makes my Toolbar not scroll away, but it makes the TabLayout only return when scrolled to the top of the list. Changing

Toolbar behind status bar in one fragment but not the other

主宰稳场 提交于 2019-12-12 13:43:26
问题 So I've one activity and two fragments. I am adding fragment 1 and the toolbar appears as expected However, the toolbar in the fragment2 appears behind the toolbar. Edit So there are two ways of displaying Fragment 2, the first is by displaying by click in Fragment 1 and the other is when the host activity is launched displaying Fragment 2. Regardless, the same method is called each time. However when launching Fragment2 directly from the activity, the toolbar displays as expected but if

Creating custom toolbar?

自作多情 提交于 2019-12-12 11:26:59
问题 Please help me to create a toolbar like this home page design: . The toolbar has 3 buttons on top (3 imagebuttons) and 2 buttons below, searchbox (imagebutton) and lens (imagebutton) I've placed 3 buttons on top but I couldn't add search box and lens buttons on correct position I'm using a navigation drawer activity. The activity name is 'home' <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"

Toolbar won't disappear in action mode

六眼飞鱼酱① 提交于 2019-12-12 10:51:43
问题 I am trying to implement the feature that, when I am long clicking a list item, the action mode shall start and it shall be possible to delete one or more items. I am starting in the MainActivity DocumentsActivity a search, which starts a Fragment DocumentsFragment with the ListView and their items. The ListAdapter is initialized and set via method call setListAdapter(this.documentsAdapter) in the onCreate in the Fragment. I set various listeners on the listview in the onActivityCreated in

Change ToolBar default icon on the left

柔情痞子 提交于 2019-12-12 09:39:43
问题 I am using a ToolBar at the top at present and want to replace the default back button with a home button. But when I add item, it always adds to the right. I don't see any layout_gravity options to choose either. Is there a way to do this? MainActivity Toolbar toolbar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_delete); toolbar = (Toolbar)findViewById(R.id.app_bar); setSupportActionBar(toolbar);

How to set the color of icon in Android toolbar?

て烟熏妆下的殇ゞ 提交于 2019-12-12 09:19:41
问题 I forked a GitHub project from https://github.com/nglauber/playground/tree/master/android/DemoSearch I would like to set the color of the search icon to be pure white. At the moment, the search icon is gray in color, and is obviously different from the white text of "Demo Search". Edit: Based on some suggestions, I created a new icon using pure white (to be exact, RGB=255,255,255), and use it in place of the android:ic_menu_search. Android will tint it with a gray tone (verified with color