滚动冲突
来源:互联网 发布:软件开发过程 编辑:程序博客网 时间:2024/06/06 13:59
在ScrollView布局中加listview就会形成滚动冲突 ,结果就是显示listview的时候不是满屏的。只能显示里面一条内容。例如
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/iv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
android:scaleType="fitXY" />
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
</ScrollView>
假如我们显示的内容是A B C D E 吧
package com.example;
import android.os.Bundle;
import android.app.Activity;
import android.widget.ArrayAdapter;
import android.widget.ListView;
public class MainActivity extends Activity {
private ListView lsv;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
lsv=(ListView)findViewById(R.id.lv);
lsv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new String[]{"A","B","C","D","E"}));
}
}
这就会形成一种滚动冲突。
- 滚动冲突
- 向左滚动代码可防止冲突
- EditText和ScrollView滚动冲突
- ListView滚动和点击冲突
- scrollview和listview滚动冲突解决
- ScrollView和GridView滚动冲突的解决
- android scrollview listview 滚动冲突解决方案
- ScrollView和ListView滚动手势冲突解决方法
- 对定时器与滚动视图冲突处理
- ScrollView和EditText的滚动冲突问题
- swiperefreshLayout和webview滚动冲突(X5WebView)
- ScrollView嵌套ListView滚动冲突的解决方案
- 可滚动textView 和点击事件冲突
- tableView和scrollView滚动起冲突,tableview不能滚动
- 微信小程序自定义弹窗滚动与页面滚动冲突
- 滚动条:解决ScrollView与ListView显示冲突问题
- Android ScrollView 与其他 子View 滚动条冲突
- 解决ScrollView中嵌套ListView滚动效果冲突问题
- 关于SparseArray
- 第四周项目—Hello world!
- Raptor7
- Android项目各个文件简介
- 第五周项目二(1)两数的正差值
- 滚动冲突
- 第五周项目10,斐波那契数列问题
- 查询数据过多页面反应慢引入缓存解决方案(Redis、H2)
- 优秀的文章&优秀的学习网站之收集手册
- 慌什么,中国的互联网+只是刚刚开始
- (1)Deep learning简介
- 不会裁缝的木工绝对不是好厨师的斜杠中青年的碎碎念
- Intent的应用类型
- LeetCode:Reverse Nodes in k-Group