我的圖像按鈕是40px的高度,但我的畫廊是高度很大。現在,我的圖像按鈕佔據了它們的整個空間,並且與我的畫廊高度相同。在保持這種水平佈局的同時,是否有按鈕保持原有尺寸?LinearLayout與layout_weights與高度不同的孩子
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="20dp" >
<ImageButton
android:id="@+id/left_arrow"
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shared_arrow_left_button_selector"
android:scaleType="fitCenter" />
<Gallery
android:id="@+id/gallery"
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:spacing="15dp" />
<ImageButton
android:id="@+id/right_arrow"
android:layout_weight="3"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/shared_arrow_right_button_selector"
android:scaleType="fitCenter" />
</LinearLayout>
您能否請您添加LinearLayout的開始標籤,以便我能更好地理解它? – Badal 2012-02-01 05:00:47
更新與你正在獲得的屏幕截圖... – MKJParekh 2012-02-01 05:12:40