- HorizontalScrollView嵌套RecyclerVi
- HorizontalScrollView嵌套RecyclerVi
- 可嵌套在水平滚动布局中使用的HorizontalScrollVi
- NestedScrollView嵌套RecyclerView导致
- CollapsingToolbarLayout 与Recycle
- ViewGroup嵌套RecyclerView设置点击事件无响应
- NestedScrollView 嵌套HorizontalScr
- 解决NestedScrollView 嵌套 RecyclerVi
- ScrollView嵌套 ListView、RecyclerVi
- Android RecyclerView嵌套RecyclerVi
修改之前:
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_22">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/flYuan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_5">
<TextView
android:id="@+id/tvCumulativeMoney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/red_circle_line_shape"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_2"
android:text="已累计986元"
android:textColor="@color/red_eb"
android:textSize="@dimen/sp_14" />
<ImageView
android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_5"
android:layout_gravity="center|bottom"
android:layout_marginTop="@dimen/dp_22"
android:adjustViewBounds="true"
android:src="@mipmap/down_arrow" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_below="@+id/flYuan"
android:id="@+id/rlProList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</LinearLayout>
</HorizontalScrollView>
修改之后
<?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_30"
android:layout_marginTop="@dimen/dp_22">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/flYuan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dp_5">
<TextView
android:id="@+id/tvCumulativeMoney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/red_circle_line_shape"
android:paddingLeft="@dimen/dp_10"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_10"
android:paddingBottom="@dimen/dp_2"
android:text="已累计986元"
android:textColor="@color/red_eb"
android:textSize="@dimen/sp_14" />
<ImageView
android:layout_width="@dimen/dp_10"
android:layout_height="@dimen/dp_5"
android:layout_gravity="center|bottom"
android:layout_marginTop="@dimen/dp_22"
android:adjustViewBounds="true"
android:src="@mipmap/down_arrow" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_below="@+id/flYuan"
android:id="@+id/rlProList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
</RelativeLayout>
</HorizontalScrollView>
后来在recyclerView外边的LinearLayout改成Relativelayout布局解决了问题。
当时我试过使用Linerlayout作为其父布局,没有成功。为什么使用Relativelayout就可以,估计得看两个layout
的源码才能了解了
网友评论