如何在HorizontalScrollView中设置最右侧的FrameLayout 我想在水平滚动视图中最右边的搜索按钮。 我尝试使用android:layout\u alignParentRight=“true”但没有成功 我该怎么办? 非常感谢
如何在HorizontalScrollView中设置最右侧的FrameLayout 我想在水平滚动视图中最右边的搜索按钮。 我尝试使用android:layout\u alignParentRight=“true”但没有成功 我该怎么办? 非常感谢,android,xml,Android,Xml,我的XML代码: <?xml version="1.0" encoding="utf-8"?> <HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/folderPath_horizontalScrollView" android:la
我的XML代码:
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/folderPath_horizontalScrollView"
android:layout_width="match_parent"
android:layout_height="@dimen/actionbar_height"
android:fadeScrollbars="false"
android:fillViewport="true"
android:scrollbarThumbHorizontal="@drawable/folder_path_scrollbar_thumb"
android:splitMotionEvents="false">
<LinearLayout
android:id="@+id/folderPath_folder_path"
android:layout_width="wrap_content"
android:layout_height="@dimen/actionbar_height"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="@color/blue_B500"
android:splitMotionEvents="false" >
<FrameLayout
android:id="@+id/chat_search"
android:layout_width="@dimen/actionbar_height"
android:layout_height="@dimen/actionbar_height"
android:background="?actionBarItemBackground">
<View
android:layout_width="@dimen/_1dp"
android:layout_height="match_parent"
android:background="@drawable/divider_line" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@string/Common_003"
app:srcCompat="@drawable/ic_search" />
</FrameLayout>
</LinearLayout>
您不能,因为水平滚动视图
没有“最右侧”
HorizontalScrollView
具有无限宽度,因此它不能具有最右侧
将搜索图像视图移到相对范围内的水平滚动视图
之外,然后可以执行布局\u alignParentRight