0
我想将textview放在搜索栏下。我使用了layout_below,但文字没有显示。Android XML layout_below不起作用
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.arlib.floatingsearchview.FloatingSearchView
android:layout_margin="@dimen/cardview_margin"
android:id="@+id/map_floating_search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:floatingSearch_close_search_on_keyboard_dismiss="true"
app:floatingSearch_leftActionMode="showHamburger"
app:floatingSearch_searchBarMarginLeft="@dimen/search_view_inset"
app:floatingSearch_searchBarMarginRight="@dimen/search_view_inset"
app:floatingSearch_searchBarMarginTop="@dimen/search_view_inset"
app:floatingSearch_searchHint="Search for a room..."
app:floatingSearch_showSearchKey="false"
app:floatingSearch_suggestionsListAnimDuration="250" />
<EditText
android:layout_margin="@dimen/cardview_margin"
android:id="@+id/edit_text_destination"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/map_floating_search_view"
android:hint="To" />
<Button
android:id="@+id/directions_go_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_margin="@dimen/cardview_margin"
android:text="GO!" />
<CheckBox
android:id="@+id/checkbox_routing_criteria"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:onClick="onCheckboxClicked"
android:text="@string/avoid_indoor_pathways"
android:layout_margin="@dimen/cardview_margin"
android:textColor="@color/colorPrimary" />
</RelativeLayout>
我想edit_text_destination在FloatingSearchView下。我不知道为什么它不起作用。如果我用另一个textview替换FloatingSearchView,它可以工作。我正在努力一段时间。有人能帮助我吗?
感谢
您是否检查过在库样本中实现的方式?从那里采取一些想法。也许这会帮助你。 –
'FloatingSearchView'膨胀['floating_search_layout.xml'](https://github.com/arimorty/floatingsearchview/blob/a0f8fbc90d98eb1b629c6295dd2d3577412e7b1e/library/src/main/res/layout/floating_search_layout.xml),它有'match_parent/match_parent高度。 – azizbekian