android-toolbar

Android toolbar not showing overflow menu

孤街醉人 提交于 2019-12-01 05:56:42
I'm new to android apps and I'm hoping someone with keen eyes can spot what I'm doing wrong. I've tried to follow the steps here , to create a toolbar for my application. However, it's not showing the three dots overflow menu (which I thought was automatic). Here's what I see: I'm using minSdkVersion 19 . MainAcivitiy.java import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; public class MainActivity extends AppCompatActivity { @SuppressLint("ShowToast") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Ripple effect on Toolbar cut off

旧城冷巷雨未停 提交于 2019-12-01 05:22:27
问题 I'm using a Toolbar in my app and am inflating it with a menu. I have a issue here because the ripple effect is automatically added to the button but the left most button's ripple effect is cut off by the boundary of the menu area. You can see the ripple expand but it is then but off on the left side. Any idea how to remedy this issue? 回答1: I came across this too, after playing around I found our custom ThemeOverlay had its background set. Try removing android:background from your Toolbar

How to change change text and arrow color on Toolbar?

吃可爱长大的小学妹 提交于 2019-12-01 03:29:54
I am currently building an app using the new material design guidelines. I am using a Toolbar rather than an action bar. I want the text, overflow icon, and the arrow/hamburger icon (thing that flips over when you pull out the navigation draw) to be white rather than black, but the rest of my theme needs to be the AppCompat.light theme. If someone could please explain how i would go about changing these things, i would be very greatful. I also need to change the colors both in xml and via java code. And on a sub note, does anyone know how i set a sub-text in the toolbar? I read it is possible,

How to click views behind a Toolbar?

谁说我不能喝 提交于 2019-12-01 03:24:21
I have a toolbar with a transparent/translucent background that overlays the content. So, behind the toolbar, views can appear that are clickable. The problem is that they can not be clicked through the toolbar because the toolbar is catching the click event. I tried setting android:clickable="false" , android:focusable="false" and android:focusableInTouchMode="false" for the toolbar, but it has no effect. How can I send a click through the toolbar to the underlying view? Matthias Robbers Take a look at the implementation of Toolbar . It eats touch events , regardless of the clickable

Can I use a actionLayout on the overflow menu of android.support.v7.widget.Toolbar?

佐手、 提交于 2019-12-01 03:14:20
I'm trying to use a SwitchCompat widget on the overflow menu of android.support.v7.widget.Toolbar but I just can't get it to work, it always appears blank. Here is my menu definition: <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" tools:context="com.oveflowtest.ScrollingActivity"> <item android:id="@+id/action_settings" android:orderInCategory="100" android:title="@string/action_settings" app:showAsAction="never"/> <item android:id="@+id/test" app:actionLayout="@layout

Android toolbar not showing overflow menu

拥有回忆 提交于 2019-12-01 03:08:14
问题 I'm new to android apps and I'm hoping someone with keen eyes can spot what I'm doing wrong. I've tried to follow the steps here, to create a toolbar for my application. However, it's not showing the three dots overflow menu (which I thought was automatic). Here's what I see: I'm using minSdkVersion 19 . MainAcivitiy.java import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; public class MainActivity extends AppCompatActivity { @SuppressLint("ShowToast")

Change Toolbar background color programmatically does not change Toolbar Title Background color

时间秒杀一切 提交于 2019-12-01 02:12:31
I´m trying to change the toolbar Background color programmatically by doing this: getSupportActionBar().setBackgroundDrawable(newColorDrawable(getResources().getColor(R.color.test_color_blue))); And this is the result: before: After: Some how the toolbar title still has the same background color as before. here is my toolbar xml: <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" app:popupTheme=

android title won't show in toolbar

佐手、 提交于 2019-12-01 02:06:21
I have an xml that I use with so many activities with fragments file but my problem is that I can't display the text I want in the toolbar, I use that xml that way because I have a navigation drawer and I needed to handle somethings so I had to do it that way. my xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/frame_container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".StatusActivity" android:orientation="vertical" > <android.support.v7.widget.Toolbar

Android Toolbar actionLayout of Switch causes text to jump when menu is pressed

不问归期 提交于 2019-12-01 00:33:22
Please refer to my project at: https://github.com/paulpv/ToolbarSwitch I am working on a simple custom layout for the Android Toolbar (aka: new ActionBar). This simple control adds a Switch to the Toolbar, and can be seen here highlighted in magenta: My problem is that immediately when the overflow menu is pressed, the Switch's Text jumps to the top of the Toolbar, and remains that way when you close the overflow menu: A similar thing happens in Landscape orientation (the subtle difference being that the overflow menu popup doesn't have any top padding). What can I do to my menu item's

Can I use a actionLayout on the overflow menu of android.support.v7.widget.Toolbar?

别说谁变了你拦得住时间么 提交于 2019-11-30 23:25:11
问题 I'm trying to use a SwitchCompat widget on the overflow menu of android.support.v7.widget.Toolbar but I just can't get it to work, it always appears blank. Here is my menu definition: <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" tools:context="com.oveflowtest.ScrollingActivity"> <item android:id="@+id/action_settings" android:orderInCategory="100" android:title="@string