これはかなり奇妙です。私は一連のタブを持っており、1 つ (実際には 2 つですが、内容がわずかに異なる同じものです) が動作しています。2 つの XML ファイルがあります。1 つは風景用で、問題なく動作します。もう1つはポートレート用で、動作がおかしいです。その下にxmlを添付します。ページのセットアップ方法では、ルート レイアウトとして線形レイアウトがあります。次に、水平線形レイアウトと相対レイアウトを含むスクロール ビューがあります。それらは互いにスタックすることになっています。そのために、横向きバージョンの逆を行いました。各レイアウトで、高さを 0dp に、重みを 1 に設定しました。横向きバージョンでは、これはうまく機能し、想定どおりに間隔を空けます。スクロール ビューには、true とマークされたフル ビュー ウィンドウがあり、高さの後にタグまたは宣言などがあります。
しかし、ポートレート バージョンでは、Eclipse では正しくレンダリングされますが、私のデバイス (Samsung Galaxy Tab 2 10.1) では正しくレンダリングされません。関連する場合は、特にこの画面とデバイスをターゲットにしています。
誰にもアイデアはありますか?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="true"
android:orientation="vertical" >
<!-- the id itemListItemList is named that way on purpose -->
<!-- This will be filled programmatically as items are added to the inventory -->
<ScrollView
android:id="@+id/itemListScrollView"
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scrollbarStyle="insideOverlay" >
<LinearLayout
android:id="@+id/itemListItemList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical" >
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="@+id/itemListRelLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" >
<EditText
android:id="@+id/itemListItemName"
style="@style/item_list_label_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/label_background"
android:clickable="false"
android:cursorVisible="false"
android:ems="10"
android:focusable="false"
android:focusableInTouchMode="false"
android:hint="@string/item_list_item_label"
android:inputType="none"
android:paddingLeft="11dp"
android:singleLine="true" />
<EditText
android:id="@+id/itemListItemTag"
style="@style/item_list_label_style"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/label_background"
android:clickable="false"
android:cursorVisible="false"
android:ems="10"
android:focusable="false"
android:focusableInTouchMode="false"
android:hint="@string/item_list_tag_label"
android:inputType="none"
android:paddingLeft="11dp"
android:singleLine="true" />
</LinearLayout>
<EditText
android:id="@+id/itemListItemDescSym"
style="@style/item_list_label_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/linearLayout1"
android:layout_marginTop="23dp"
android:background="@drawable/label_background"
android:clickable="false"
android:cursorVisible="false"
android:ems="10"
android:focusable="false"
android:focusableInTouchMode="false"
android:hint="@string/item_list_desc_sym_label"
android:inputType="none"
android:paddingLeft="11dp"
android:singleLine="true" />
<EditText
android:id="@+id/itemListItemExceptions"
style="@style/item_list_label_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/itemListItemDescSym"
android:layout_marginTop="26dp"
android:background="@drawable/label_background"
android:clickable="false"
android:cursorVisible="false"
android:ems="10"
android:focusable="false"
android:focusableInTouchMode="false"
android:hint="@string/item_list_exceptions_label"
android:inputType="none"
android:paddingLeft="11dp"
android:singleLine="true" />
<!--
<Button
android:id="@+id/item_list_void_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/item_list_clear_button"
android:layout_alignBottom="@+id/item_list_clear_button"
android:layout_alignParentRight="true"
android:layout_marginRight="27dp"
android:text="@string/item_list_void_button" />
-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >
<Button
android:id="@+id/item_list_edit_button"
android:layout_width="wrap_content"
android:layout_height="75dp"
android:layout_gravity="left"
android:layout_weight="1"
android:text="@string/item_list_edit_button" />
<Button
android:id="@+id/item_list_clear_button"
android:layout_width="wrap_content"
android:layout_height="75dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:text="@string/item_list_clear_button" />
<Button
android:id="@+id/item_list_void_button"
android:layout_width="wrap_content"
android:layout_height="75dp"
android:layout_gravity="right"
android:layout_weight="1"
android:text="@string/item_list_void_button" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>