android toolbar for pre lollipop devices -
When I changed from ActionBar to Toolbar, I had to face many issues. I listed them here
1 ) I have several pieces that have been changed / using backstacks. Everything was working fine when I pressed the back button, but when I switch to the toolbar, the application closes when I press the back button.
2 ) The background of the popup menu is black
& lt; Item name = "Android: popup menu style" & gt; @ Style / popup menu & lt; / Item & gt; & Lt; Style name = "PopupManu" parent = "@ Android: Style / widget. Popup menu" & gt; & Lt; Item Name = "Android: Popup Background" & gt; @Android: color / white & lt; / Item & gt; & Lt; / Style & gt;
Even this did not work.
If I use AppCompat. The light theme, the background color of the popup menu is white, but then the navigation indicator icon and black
3 ) This is my menu style, the item "add" is not shown here with id. Instead, I have always used showAsAction in this menu (in the menu when I press that 3 vertical dots button), but the icon appears Does not.
& lt; Menu xmlns: android = "http: // schema .android.com / apk / ridge / android" xmln: tools = "http://schemas.android.com/tools" tool: reference = ".com.hirak.assistere_doit .do_it_main_screen "& gt; & Lt; Item android: id = "@ + id / action_settings" Android: orderInCategory = "100" Android: showAsAction = "never" android: title = "settings" /> & Lt; Item android: id = "@ + ID / Add" Android: Icon = "@ Drable / Ed" Android: ShowAsaction = "Always" /> & Lt; / Menu & gt;
For the popup menu style, you need to apply a popup
& lt; Android.support.v7.widget.Toolbar Android: AD = "@ + ID / toolbar" app: subject = "@ style / actionbore" Android: layout_width = "match_perrent" android: layout_hete = "wrap_content" app: popuptheme = " @ Style / Toolbops "/>
And then in your theme, override the values you want to change
Add to your Toolbar to whiten the Navigation Indicator
& lt; Style name = "ActionBar" parent = "Widget.AppCompat.Toolbar" & gt; ... and lieutenant; Item name = "Android: Text collar secondary" & gt; @color / white & lt; / Item & gt; & Lt; Item name = "Action menu textclosure" & gt; @color / white & lt; / Item & gt; & Lt; Item name = "android: textColorPrimary" & gt; @color / white & lt; / Item & gt; & Lt; / Style & gt;
For back button issues, I'll need more information - code etc.
Comments
Post a Comment