在滚动视图中使用列表视图
在我的项目中,我使用了setcontentview(R.layout.first).here
。在画廊中,我正在显示 second.xml
。在 second.xml
中,我有一个 listview.when
。我正在尝试滚动这些 listviewitems
总屏幕滚动,但它滚动不正确。因为外面我们用的是scrollview。当我删除外部滚动视图时,我们看不到列表视图的底部。如何解决这个问题?
In my project I used setcontentview(R.layout.first).here
. In a gallery I am displaying second.xml
. In second.xml
I have one listview.when
. I am trying to scroll these listviewitems
total screen scrolling, but it is not scrolling properly. Because outside we used scrollview. When I delete outside scrollview we cannot see the bottom of listview
. How to resolve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用
ListView
的 标题 和 页脚如果你想放一些仅在ListView
末尾/开头的项目。观看此视频(从 42:40 开始),非常有用。
Use
ListView
's headers and footers if you want to put some items only at the end/beginning of theListView
.Watch this video beginning from 42:40 it's really useful.
一旦列表视图超过其父级高度或 ListViews 最大高度,它将自动滚动
A list view will scroll automatically once it goes past its parents height or the ListViews maximum height
如果您将 ListView/任何可滚动视图放入滚动视图中,它将无法正常工作,因为当您触摸屏幕时,触摸的主要焦点是父视图(scrollView)而不是子视图(ListView)。
If you put your ListView/any scrollable View inside the scrollView it will not work properly because when you touch the screen ,main focus of your touch is on parent view(scrollView ) not the child View (ListView).
ScrollView 中的 ListView 是不可能的。
ListView inside ScrollView is not possible.
我没有任何现成的示例,
所以按照您在评论中的要求编写了这样的原始代码,
I have no any ready example with me,
So written a raw code like this as you asked in comment,