您的位置:首页 > 移动开发 > Android开发

android 里listview和ScrollView的冲突问题

2015-10-23 14:24 549 查看
最近再写的客户端中出现了listView和ScrollView冲突的问题,就是往下滑动的时候只有listview在滑动,而实现的效果是要整体LinearLayout滑动,所以修改代码如下,将需要实现ScrollView效果的代码写成即可:

<ScrollView
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout

android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="vertical"

android:id="@+id/my_page">


即添加一个 android:fillViewport=”true”即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息