[英]How to set listviews in horizontalScrollView to fill up the screen?
I have three listviews in horizontalScrollView. 我在horizontalScrollView中有三个列表视图。 I want to make each of them to occupy the full screen, by including them into a linearlayout which is set to (layout_width: match_parent, layout_height: match_parent).
我想通过将它们包含到设置为(layout_width:match_parent,layout_height:match_parent)的linearlayout中,使它们各自占据全屏。 However, it doesn't work.
但是,它不起作用。 As you see from the screenshot, the three listviews just tightly linked with one another.
从屏幕截图中可以看到,三个列表视图彼此紧密链接。
Any suggestions so that the three listviews each occupies the full screen? 有什么建议可以使三个列表视图全屏显示吗? THx a lot.
多谢。
<HorizontalScrollView
android:id="@+id/horizontalScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/page_bg_color">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/tab_login_myFriends_requestList"
android:background="#ffffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/tab_login_myFriends_pendingList"
android:background="#ffffffff" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/tab_login_myFriends_confirmedList"
android:background="#ffffffff" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
Use this, 用这个,
http://developer.android.com/reference/android/widget/ScrollView.html#attr_android:fillViewport http://developer.android.com/reference/android/widget/ScrollView.html#attr_android:fillViewport
Set that to true. 将其设置为true。 Also your listviews should probably have a weight attribute associated with them.
另外,您的列表视图可能应该具有与之关联的weight属性。
But I can't really figure out what you're trying to do. 但是我真的无法弄清楚您要做什么。 Maybe provide the xml and I'll guide you further.
也许提供xml,我会进一步指导您。
I think what you're looking for is this, 我认为您正在寻找的是
http://developer.android.com/training/animation/screen-slide.html http://developer.android.com/training/animation/screen-slide.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.