ListView控件没有得到空间去展示在小屏幕上的内容 [英] ListView not getting space to show content on smaller screens
问题描述
所以,我制定哪里有顶部和下面的一些图片和按钮的屏幕是显示了一些活动的名单列表视图。
So I am developing a screen where there are some images and buttons on top and Below that is a list view which shows a list of some activity.
的设计是这样的: -
The design is something like this :-
现在小屏幕上的屏幕空间是采取了由上面的图标和图像ListView的高度变得非常小。
Now on smaller screen the ListView height becomes very small as the screen space is taken up by the above icons and images.
所以,我怎么能增加的LinearLayout高度或ListView,使用户可以滚动到看到ListView控件的其余部分。
So how can i increase the height of the Linearlayout or ListView so that user can scroll to the see the rest of the ListView.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
.... Other Layouts .....
<ListView
android:id="@+id/listArea"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:paddingLeft="@dimen/list_padding"
android:paddingRight="@dimen/list_padding" />
</LinearLayout>
编辑:使用顶部视图作为头列表中,但因为我想要一个EmptyView过,这是创建一个问题,因为它替换整个头+试过的ListView
Tried using the top view as a header to the List but since I want an EmptyView too, this is creating a problem as it replaces the whole header + listview
推荐答案
从我读到这个问题,您应该指定顶部视图为<一个href=\"http://developer.android.com/reference/android/widget/ListView.html#addHeaderView%28android.view.View%29\"相对=nofollow>清单的标题,the'll正常滚动。
From what I read about that issue, you should specify the Views on top as header of the list, and the'll scroll properly.
AFAIK这只是工作,如果该列表不为空,为空视图替换整个列表,包括头。
Afaik this only works if the list is non-empty, as the empty view replaces the whole list including headers.
这篇关于ListView控件没有得到空间去展示在小屏幕上的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!