
这些是我的布局.
<androID.support.v4.Widget.nestedScrollVIEw xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:app="http://schemas.androID.com/apk/res-auto" xmlns:tools="http://schemas.androID.com/tools" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_vIEw_behavior" tools:context=".articles.ArticlesActivity" tools:showIn="@layout/activity_articles" > <androID.support.v7.Widget.RecyclerVIEw androID:ID="@+ID/articles_Lista" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:fadeScrollbars="true" androID:scrollbars="vertical" /></androID.support.v4.Widget.nestedScrollVIEw>
我的CardVIEw布局容器.
<androID.support.v7.Widget.CardVIEw xmlns:card_vIEw="http://schemas.androID.com/apk/res-auto" xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:ID="@+ID/articles_card" androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" card_vIEw:cardCornerRadius="6dp" card_vIEw:cardUseCompatpadding="true" card_vIEw:cardPreventCornerOverlap="true" androID:layout_margintop="0dp" androID:layout_marginBottom="0dp" androID:layout_marginleft="10dp" androID:layout_marginRight="10dp" card_vIEw:cardElevation="5dp" androID:overScrollMode="always" androID:fadeScrollbars="true"> <linearLayout androID:orIEntation="vertical" androID:layout_wIDth="match_parent" androID:layout_height="match_parent"> <TextVIEw androID:layout_wIDth="match_parent" androID:layout_height="wrap_content" androID:padding="10dp" androID:ID="@+ID/article_card_Title" androID:textAppearance="?androID:attr/textAppearanceLarge" androID:textcolor="#000"/> </linearLayout></androID.support.v7.Widget.CardVIEw>
和JAVA代码:
RecyclerVIEw recyclerVIEw = (RecyclerVIEw)findVIEwByID(R.ID.articles_Lista); linearlayoutmanager layoutManager = new linearlayoutmanager(this,linearlayoutmanager.VERTICAL,false); recyclerVIEw.setLayoutManager(layoutManager); ArticlesAdapter adapter = new ArticlesAdapter(Mock.getNoticias(1L),this); recyclerVIEw.setAdapter(adapter);
谢谢.
编辑:
我的新布局正常工作,看起来像:
<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:app="http://schemas.androID.com/apk/res-auto" xmlns:tools="http://schemas.androID.com/tools" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_vIEw_behavior" tools:context="newser.sab.com.newser.articles.ArticlesActivity2" tools:showIn="@layout/app_bar_articles2"> <androID.support.v7.Widget.RecyclerVIEw androID:ID="@+ID/articles_Lista" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:fadeScrollbars="true" androID:scrollbars="vertical" /></relativeLayout>解决方法 正在改变布局:
<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"xmlns:app="http://schemas.androID.com/apk/res-auto"xmlns:tools="http://schemas.androID.com/tools"androID:layout_wIDth="match_parent"androID:layout_height="match_parent"app:layout_behavior="@string/appbar_scrolling_vIEw_behavior"tools:context="newser.sab.com.newser.articles.ArticlesActivity2"tools:showIn="@layout/app_bar_articles2"><androID.support.v7.Widget.RecyclerVIEw androID:ID="@+ID/articles_Lista" androID:layout_wIDth="match_parent" androID:layout_height="match_parent" androID:fadeScrollbars="true" androID:scrollbars="vertical" />总结
以上是内存溢出为你收集整理的android – 循环视图上的加速滚动全部内容,希望文章能够帮你解决android – 循环视图上的加速滚动所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)