布局问题:Listview将View推到屏幕之外
我有两个文本视图,一个列表视图(顺便说一下,这是一个列表活动)和一个日期选择器。所有内容都应该按此顺序垂直显示。
问题在于 ListView 将日期选择器推到屏幕下方,推到看不见的世界的深处。我希望日期选择器有自己的空间,固定在底部,而列表视图根据需要增长,但仍然允许日期选择器有自己的空间。
+/- 像这样:
~~~~~~~~~~~~~~~ screen top
TextView 1
TextView 2
|
|
|
| ListView [*]
|
|
|
DatePicker (stays here no matter how much List grows or shrinks
~~~~~~~~~~~~~~~ screen bottom
[*] ->这个列表视图会滚动很多,但不会隐藏日期选择器!
我知道要求现成的代码很懒,但是你们能分享一下吗?这让我发疯。我相信我已经尝试了数百万种组合。
非常感谢。这就是完成我的第一个应用程序所需的全部! :-(
I have two textviews, a listview (this is a listactivity, by the way) and a datepicker. All is supposed to be displayed in this order, vertically.
The problem is that the ListView is pushing the datepicker below the screen, to the depths of the unseen world. I want the datepicker to have its own space, fixed at the bottom, while the listview grows as needed, but still allowing datepicker to have its own space.
+/- like this:
~~~~~~~~~~~~~~~ screen top
TextView 1
TextView 2
|
|
|
| ListView [*]
|
|
|
DatePicker (stays here no matter how much List grows or shrinks
~~~~~~~~~~~~~~~ screen bottom
[*] -> This listview will scroll a lot, but won't hide datepicker!
I know it's very lazy to ask for ready code, but could you guys share a light? This is driving me crazy. I've tried millions of combinations I believe.
Thank you a lot. This is all I need to finish my first app! :-(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用
RelativeLayout
:顺便说一下,我刚刚给了您基本且重要的部分...您将需要完成代码(例如,您必须为
提供宽度和高度relativeLayout
标签,放置你的TextViews
等)Use
RelativeLayout
:By the way, I just gave you the basic and important part... you will need to complete the code (for instance, you have to give a width and height to the
RelativeLayout
tag, put yourTextViews
, etc.)