0

画像が画面の 60% を占める xml があります。

                   <RelativeLayout
                        android:id="@+id/rl_images_layout"
                        android:layout_width="0dp"
                        android:layout_weight="6"
                        android:layout_height="wrap_content" 
                        android:layout_marginBottom ="5dp">

                        <com.my.proj.view.ContentUpdatableImageView
                            android:id="@+id/iv_template1_image"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:adjustViewBounds="true"
                            android:scaleType="fitStart" />

                        <ImageView
                            android:id="@+id/ivResizeIcon"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignRight="@id/iv_template1_image"
                            android:layout_alignTop="@id/iv_template1_image"
                            android:background="@drawable/btn_pinch" />

                        <ImageView
                            android:id="@+id/ivRotateIcon"
                            android:layout_width="55dp"
                            android:layout_height="55dp"
                            android:layout_alignRight="@id/iv_template1_image"
                            android:layout_alignBottom="@id/iv_template1_image"
                            android:layout_marginRight="5dp"
                            android:layout_marginBottom="5dp"
                            android:background="@drawable/btn_rotate"
                            android:visibility="gone" />
                 </RelativeLayout>
                 <View 
                     android:layout_width="0dp"
                     android:layout_height="fill_parent"
                     android:layout_weight="4" />

1 台の電話 (LG P500) では問題なく動作しますが、別のデバイス (HTC Desire HD) では画像が 40% しか表示されません。何か案は?

4

3 に答える 3

1

あなたは一つのことを逃しました。

android:layout_weight両方のビューを使用している場合は、fill_parent/match_parentパラメータを次のようにする必要がありますlayout_heigth(画面を広げたい場合)

したがってlayout_heigth、最初のビューを次のように変更します。

android:layout_height="fill_parent" 
于 2012-06-07T12:07:14.820 に答える
0

これを試して

    android:weightSum="100"  //for parent layout 

    android:layout_weight="60" // for first child //In your case relative layout

    android:layout_weight="40" //for second child //In your case view
于 2012-06-07T11:50:56.377 に答える
0

画素密度のせいだと思う

これをチェックしてください

Android: 画面サポート

于 2012-06-07T11:48:32.277 に答える