Looks like
I added a SearchView in the toolbar and a label at the bottom of that toolbar.
But when I expand SearchView to type, it hides / deletes all the labels
activity_search.xml:
Additionally, I am on the left side How do I get search labels on lines similar to icons?activity_search.xml:
& lt; Relative layout xmlns: Android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" xmlns: app = "http: // schemas .android.com / apk / res-auto "Android: layout_width =" match_parent "Android: layout_height =" match_parent "tool: reference =". Search search "& gt; & Lt; android.support.v7.widget.Toolbar Android: "attr / actionBarSize": "attr / colorPrimary": id = "@ + id / top_toolbar" Android MinHeight = Android background = Android: layout_width = "match_parent" Android: Layout_height = " 80dp "App: Theme =" @ Style / Theme Overlay. AppCompat.Dark.ActionBar "App: PopupTheme =" @ Style / Theme Overlay. AppCompat.Light "& gt; & Lt; TextView android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: layout_gravity = "center | bottom" Android: PaddingBottom = "L6dp" android: text = "label" / & gt; & Lt; /android.support.v7.widget.Toolbar> & Lt; / RelativeLayout & gt;
menu_search.xml
& lt; 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 "tool: context =" search search "& gt; & Lt; Item android: id = "@ + id / action_search" android: icon = "@ android: drawable / ic_menu_search" app: ShowAsAction = "always" app: ActionViewClass = "Androidksupportkv7kwidgetkSearchView" android: title = "Search" /> & Lt; Android: id = "@ + id / action_settings" Android: title = "@ string / action_settings" Android: orderInCategory = "100" app: showAsAction = "never" />
I decided to add SearchView directly to that issue Instead of adding Toolbar's tool to the menu because the reinstallation of that label is not fixed, I use the frame layout inside the toolbar. In addition to this, I added the maximum width to SearchView, because the extended search view overlaps titleLabel
XML of my toolbar:
Android Support.v7.widget.Toolbar android: id = "@ + id / search_toolbar" Android: layout_width = "match_parent" Android: layout_height = "70dp" android: background = "attr / colorPrimary?" Android: MinHeight = app "attr / actionBarSize?": Theme = "@ style / Thymowhrle. App Compet. Dark Actionbar" app: Popapthym = "@ style / theme overlay. App Compet. Light" & gt; & Lt; FrameLayout Android: layout_width = "match_parent" Android: layout_height = "match_parent" & gt; & Lt; Android: layout_width = "wrap_content" android: layout_height = "@dimen / abc_action_button_min_height_material" Android: text = "title" Android: layout_gravity = "left | top" Android: gravity = "center_vertical | left" Android: paddingTop = "@ Dimen / abc_action_bar_default_padding_material "android: id =" @ + id / toolbar_title "Android: textcolor =" @ color / abc_primary_text_material_dark "Android: textSize =" @ Dimen / abc_text_size_title_material_toolbar "/ & gt; & Lt; TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "toolbar title" Android: layout_gravity = "center | bottom" android: id = "@ + id / toolbar_label" /> & Lt; Android: maxWidth = "250dp" Android: paddingTop = "@Dimen / Android: layout_width =" wrap_content "android: layout =" id " Abc_action_bar_default_padding_material "/> & Lt; / FrameLayout & gt; & Lt; /android.support.v7.widget.Toolbar>
No comments:
Post a Comment