このレイアウトをより見栄えようとしています。マニフェストに追加するまではすべてが見つかりました。それ以来、すべてがちょっと収縮しています。 use minSdkディレクティブを追加したのは、私のアプリを実行するwildfireなどのqvgaデバイスを許可するためです。小さい表示のAndroid xmlレイアウトの問題
イメージはスペースを埋めることはなく、中央のほうが小さいか、LinearLayout Parentです。
また、下部のギャラリーは非常に小さく、ギャラリー内のアイテムをクリックするのが難しくなっています。
誰か提案がありますか?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff">
<LinearLayout
android:id="@+id/header"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="100px"
android:background="#ffffff">
<TextView
android:text="header"
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginLeft="10px"></TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/footer"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/examplegallery"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff" />
</LinearLayout>
<LinearLayout
android:id="@+id/body"
android:layout_below="@id/header"
android:layout_above="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<!-- Whatever your body is -->
<ImageView
android:src="@drawable/icon"
android:layout_width="fill_parent"
android:layout_gravity="center"
android:id="@+id/imageView1"
android:layout_height="120dp"></ImageView>
</LinearLayout>
<TableRow android:layout_height="wrap_content"
android:layout_width="wrap_content" android:id="@+id/tableRow1" android:layout_above="@+id/scrollView1" android:layout_alignParentLeft="true">
<TextView
android:text="price"
android:id="@+id/price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#09bade"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_marginRight="20px"
android:layout_marginLeft="10px"
></TextView>
<TextView
android:text="quickcode"
android:id="@+id/quickcode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff8400"
android:layout_marginRight="20px"
>
</TextView>
<TextView
android:text="stock"
android:id="@+id/stock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ff8400"
></TextView>
</TableRow>
<ScrollView android:id="@+id/scrollView1" android:layout_width="wrap_content" android:layout_height="150px" android:layout_above="@+id/footer" android:layout_marginLeft="10px" android:layout_marginBottom="10px">
<TextView
android:text="scroll"
android:id="@+id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_marginLeft="10dip"></TextView>
</ScrollView>
<Button android:id="@+id/button1" android:layout_height="wrap_content" android:text="Wishlist" android:layout_width="wrap_content" android:layout_alignBottom="@+id/tableRow1" android:layout_alignParentRight="true"></Button>
</RelativeLayout>
ありがとう、すぐにこれを試してみようbbs – brux
imageviewにlayout_weight = "1"を追加しようとしましたが、それは不幸にも違いはありません。親LinearLayoutに同じ画像を追加するときと同じです。 – brux
wierd、私には、レイアウトが取り込まれていない残りの画面をカバーするようにしたいときにコードが動作します。おそらくweightSumを使用してみますか? – Androider