代码布局?
<android.support.v4.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll">
<com.youth.banner.Banner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_166"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_1"
android:layout_marginRight="@dimen/dp_15"
android:visibility="visible" />
<com.pdxx.xxpt.view.MyGridView
android:visibility="gone"
android:id="@+id/my_grid_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:horizontalSpacing="10dp"
android:numColumns="5"
android:scrollbars="none"
android:verticalSpacing="10dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_20"
android:text="我的学习"
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:visibility="visible"
app:layout_scrollFlags="scroll">
<ImageView
android:id="@+id/my_course"
android:layout_width="@dimen/dp_222"
android:layout_height="@dimen/dp_123"
android:layout_marginLeft="@dimen/dp_7"
android:layout_marginTop="@dimen/dp_7"
android:background="@mipmap/home_my_class" />
<ImageView
android:id="@+id/more"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_123"
android:layout_marginTop="@dimen/dp_7"
android:layout_marginRight="@dimen/dp_7"
android:scaleType="fitXY"
android:src="@mipmap/home_more" />
</LinearLayout>
<LinearLayout
android:id="@+id/notice"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_20"
android:layout_marginTop="@dimen/dp_12">
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_12"
android:src="@drawable/ic_todo" />
<TextView
android:id="@+id/notice_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_16"
android:textColor="@color/bg_common_dialog"
android:textSize="@dimen/sp_14"
tools:text="【通知】待参加的教学活动" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_3"
android:background="#F9F9F9" />
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_42"
app:tabIndicatorColor="@color/tabIndicatorColor"
app:tabIndicatorHeight="@dimen/dp_3"
app:tabSelectedTextColor="@color/tabIndicatorColor"
app:tabMode="scrollable"
app:tabTextAppearance="@style/TabLayoutTextStyle" />
</LinearLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycleView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:background="@color/white"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
可以和上面的一起来滑动, 现在还有一个问就是滑动的 有种阻塞的感觉 , 没有以前的惯性
需要设置
recycleView.setNestedScrollingEnabled(false);
|