android-toolbar

Text background issue on Toolbar

巧了我就是萌 提交于 2020-06-26 03:50:05
问题 When adding some alpha to my Toolbar background color, I notice there is a background applied to the title's TextView: Here is my layout: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="#0099cc"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width=

how can i do a rounded toolbar/actionbar in android studio with code like this in the image? [closed]

大兔子大兔子 提交于 2020-05-30 07:00:01
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 months ago . I'm trying to do this, with code and not with background image 回答1: Define xml file like this (this is how i rounded my botton) put the xml file in drawable folder <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android

ANDROID: Error inflating class android.support.design.widget.AppBarLayout

可紊 提交于 2020-05-14 21:32:08
问题 I added a toolbar to my layout and now I get this error when running: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapp/mainactivity.MainActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #2: Error inflating class android.support.design.widget.AppBarLayout This is my activity layout: <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas

Set Toolbar layout direction to RTL, with `supportsRtl=“false”`

人盡茶涼 提交于 2020-04-13 04:03:15
问题 I have a special situation that I am not able to find a solution for. I am trying to force a view to be laid-out in RTL, but one of the restrictions is that supportsRtl must be false in the manifest. <!-- AndroidManifest.xml --> <application android:supportsRtl="false"> <!-- layout/activity.xml --> <android.support.v7.widget.Toolbar android:layoutDirection="rtl" android:layout_width="match_parent" android:layout_height="wrap_content"/> The problem I'm having is that android:layoutDirection

Set Toolbar layout direction to RTL, with `supportsRtl=“false”`

只谈情不闲聊 提交于 2020-04-13 04:03:08
问题 I have a special situation that I am not able to find a solution for. I am trying to force a view to be laid-out in RTL, but one of the restrictions is that supportsRtl must be false in the manifest. <!-- AndroidManifest.xml --> <application android:supportsRtl="false"> <!-- layout/activity.xml --> <android.support.v7.widget.Toolbar android:layoutDirection="rtl" android:layout_width="match_parent" android:layout_height="wrap_content"/> The problem I'm having is that android:layoutDirection

How to change toolbar text color from MaterialComponents.DayNight theme?

橙三吉。 提交于 2020-02-22 04:14:06
问题 I am using MaterialComponents.DayNight theme in my app. In the day mode, toolbar text color is black. But when I switch to night mode toolbar text color is remain black, so it's not visible anymore. <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> I want to change the toolbar text color into white in night mode. How can I do that? 回答1: Add this entry to your theme: <item name="android:itemTextAppearance">@style/PopupMenuTextAppearance</item> After that, add the

How to change toolbar text color from MaterialComponents.DayNight theme?

試著忘記壹切 提交于 2020-02-22 04:13:59
问题 I am using MaterialComponents.DayNight theme in my app. In the day mode, toolbar text color is black. But when I switch to night mode toolbar text color is remain black, so it's not visible anymore. <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> I want to change the toolbar text color into white in night mode. How can I do that? 回答1: Add this entry to your theme: <item name="android:itemTextAppearance">@style/PopupMenuTextAppearance</item> After that, add the

How to change toolbar text color from MaterialComponents.DayNight theme?

天涯浪子 提交于 2020-02-22 04:13:25
问题 I am using MaterialComponents.DayNight theme in my app. In the day mode, toolbar text color is black. But when I switch to night mode toolbar text color is remain black, so it's not visible anymore. <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> I want to change the toolbar text color into white in night mode. How can I do that? 回答1: Add this entry to your theme: <item name="android:itemTextAppearance">@style/PopupMenuTextAppearance</item> After that, add the

How to make the distance between left edge of Toolbar and Search Icon same as that between the right edge of the toolbar and the Cancel Icon?

我们两清 提交于 2020-01-28 02:45:48
问题 I am trying to add a SearchView to Material Design Toolbar / ActionBar such that the SearchView is expanded by default and takes up the entire space of the Toolbar width-wise. I have the following Toolbar so far. The problem with it is: I want the Search icon to have the same distance from the left edge of the screen as that of the X icon from the right edge of the screen. How can I do that? The X icon appears only when I start typing a search query, and then it disappears if I cancel the

How to make the distance between left edge of Toolbar and Search Icon same as that between the right edge of the toolbar and the Cancel Icon?

十年热恋 提交于 2020-01-28 02:45:06
问题 I am trying to add a SearchView to Material Design Toolbar / ActionBar such that the SearchView is expanded by default and takes up the entire space of the Toolbar width-wise. I have the following Toolbar so far. The problem with it is: I want the Search icon to have the same distance from the left edge of the screen as that of the X icon from the right edge of the screen. How can I do that? The X icon appears only when I start typing a search query, and then it disappears if I cancel the