下面的Android XML布局不';行不通
我想把textview放在搜索栏下面。我使用了下面的布局,但没有显示文本下面的Android XML布局不';行不通,android,android-layout,Android,Android Layout,我想把textview放在搜索栏下面。我使用了下面的布局,但没有显示文本 <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <com.arlib.floatingsearchview.FloatingSearchView android:layout_margin="@dimen/cardview_margi
<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>
我希望编辑\文本\目的地位于FloatingSearchView下。我不知道为什么它不起作用。如果我用另一个文本视图替换FloatingSearchView,它会工作。我为此挣扎了一段时间。有人能帮我吗
谢谢尝试在
com.arlib.floatingsearchview.floatingsearchview
由于搜索框占据了整个屏幕的高度,因此您正在使用的edit_text
会移到下方并离开屏幕。。您可以通过应用scrollView
来检查这一点,因此请尝试给出100dp或200dp这样的高度。
或
如果您想在单击搜索栏时禁用editText,并且不想给出静态高度,那么您也可以使用此选项
<EditText
android:id="@+id/edit_text_destination"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="99dp"
android:hint="To"
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/directions_go_button"
android:layout_alignEnd="@+id/directions_go_button"
android:layout_alignLeft="@+id/checkbox_routing_criteria"
android:layout_alignStart="@+id/checkbox_routing_criteria" />
您是否检查了它在库示例中的实现方式?从那里得到一些想法。也许这会对你有所帮助。FloatingSearchView
充气,它有match\u parent/match\u parent
高度。