android CoordinatorLayout使用问题

hahahahehehelalala 2016-06-28 06:01:45
再用CoordinatorLayout的时候有个问题,布局如下
<android.support.design.widget.CoordinatorLayout
android:id="@+id/cl"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll">

<TextView
android:id="@+id/tv1"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="#ffffffff"
android:text="adfaafdadsfasdf"
app:layout_scrollFlags="scroll" />

<TextView
android:id="@+id/tv2"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_below="@+id/tv1"
android:background="#ffffffff"
android:text="adsfasdflllllllllllll"
app:layout_scrollFlags="scroll" />
</RelativeLayout>

</android.support.design.widget.AppBarLayout>

<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

</ListView>
</android.support.design.widget.CoordinatorLayout>

我想实现在向上滑动listview时,上面的textview也跟着向上滑动,怎么设置呢
...全文
181 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
z_cp 2016-07-28
  • 打赏
  • 举报
回复
参考这个http://www.jianshu.com/p/488283f74e69
hahahahehehelalala 2016-07-22
  • 打赏
  • 举报
回复
换成recyclerview实现的
M_O_ 2016-06-29
  • 打赏
  • 举报
回复
去掉 app:layout_scrollFlags="scroll"

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧