开发者

Android: How do I evenly space images in a ScrollView?

开发者 https://www.devze.com 2023-01-24 11:21 出处:网络
I want to evenly space a vertical row of images in a开发者_如何学编程 ScrollView. I\'m telling my LinearLayout inside the ScrollView to fill_parent, but it\'s not, it\'s wrapping content. Can you pos

I want to evenly space a vertical row of images in a开发者_如何学编程 ScrollView.

I'm telling my LinearLayout inside the ScrollView to fill_parent, but it's not, it's wrapping content.


Can you post your XML? Are you putting each ImageView in a separate LinearLayout or what? Just put all your ImageViews inside a vertical LinearLayout, and add:

android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"

to all of them. That should do the trick.

EDIT: Wait, I'm confused. What are you trying to accomplish? Do you have a fixed size for your ScrollView?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号