0
我有9x2 PNG的一格,我想在我的小工具来分发线性布局,不能得到FILL_PARENT/WRAP_CONTENT右
一些技巧后,我决定去(清理代码有点)
<linearLayout
android:orientation="vertical">
<linearLayout
android:orientation="horizontal">
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
</linearLayout>
<linearLayout
android:orientation="horizontal">
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
<ImageView />
</linearLayout>
</linearLayout>
百万美元的问题是如何把元素的宽度/高度。我希望对象填充小部件的整个宽度,因此顶层的width =“fill_parent”。但除此之外,我只希望图像能很好地缩放。我似乎无法得到这个工作,并想知道我是否错过了fill_parent/wrap_content的概念。
我试着用权重参数进行试验,但由于图像有不同的大小,这只是没有解决。
任何有关如何定义上述元素的宽度/高度的帮助,使这个9x2网格填充宽度和占用尽可能多的空间作为必要的高度将不胜感激!
感谢 约翰
感谢您的帮助!我的问题是,图像有不同的宽度,范围从2到80像素。将权重设置为像素数量以获得正确的比例对我来说并没有诀窍。如何防止2像素宽的图像占用80像素宽的图像空间? –