【发布时间】:2011-07-01 02:33:11
【问题描述】:
我目前卡在横向布局上。我正在实现一个画廊,并希望它适合相对布局的高度,并通过宽度包装内容。我尝试了 scaleType centerInside,弄乱了不同类型的 layout_height/width。
我的 XML 的相关部分如下所示(我为缺少格式表示歉意):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:padding="10dip"
android:orientation="vertical">
<RelativeLayout
android:orientation="horizontal"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gallery"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:scaleType="centerInside"
/>
这里是image 截止日期。
【问题讨论】: