0

リストビューとそのリストビューの下に1つの画像が必要です。以下のコードを使用すると、リストビューと画像ビューはポートレートモードでのみ表示され、ランドスケープモードでは表示されません。誰かがそのリストを表示するための提案を教えてください。横向きのビューと画像ビューもあります。

私のxmlコードは

<?xml version="1.0" encoding="UTF-8"?>
<FrameLayout 
    android:id="@+id/FrameLayout01" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android">
    <com.google.android.maps.MapView 
            android:id="@+id/mapView" 
            android:layout_width="fill_parent" 
            android:enabled="true" 
            android:clickable="true" 
            android:apiKey="@string/apikey" 
            android:layout_height="wrap_content" 
            />
            <RelativeLayout     android:orientation="vertical"
                        android:layout_width="fill_parent"
                        android:id="@+id/linerlayouttransparent"
                        android:layout_height="fill_parent">


<LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android" 
                android:layout_width="fill_parent" 
                android:layout_height="fill_parent"
                android:orientation="vertical"
                android:gravity="top"
                android:paddingBottom="100sp"
                > 

    <com.fitzengineering.teslaworldnet.presentationlayer.TransparentPanel
            android:id="@+id/transparent_panel" 
            android:layout_width="fill_parent"
            android:paddingTop="5sp"
            android:paddingLeft="5sp"
            android:paddingRight="5sp" android:layout_height="wrap_content" android:paddingBottom="5sp">

<LinearLayout android:id="@+id/LinearLayout01" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" xmlns:android="http://schemas.android.com/apk/res/android">
<ListView android:id="@+id/ListView01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
</ListView>
<TextView android:id="@+id/TextView01" 
android:layout_height="wrap_content"
 android:layout_width="fill_parent"
  android:height="5sp">
  </TextView>
  <ImageView
   android:layout_width="wrap_content" 
  android:layout_height="wrap_content"
   android:clickable="true" android:focusable="true"
 android:src="@drawable/back_normal_icon"
android:layout_gravity="center_horizontal" 
android:id="@+id/backImageView"></ImageView>

</LinearLayout>
</com.fitzengineering.teslaworldnet.presentationlayer.TransparentPanel>
 </LinearLayout> 
 </RelativeLayout>
 </FrameLayout>
4

2 に答える 2

1

resフォルダーの下に、画像アセット用の「drawable」のようなフォルダーがある可能性があります。ポートレートモードとランドスケープモードで異なるリソースイメージ用に「drawable-port」および「drawable-land」と呼ばれるフォルダを追加できます...それぞれのフォルダに同じファイル名を付け、レイアウトコードでそのファイル名を参照するだけです。これと同じ手法をレイアウトフォルダで使用して、画像の2つのバージョンだけでは不十分な場合は、縦向きと横向きでまったく異なるレイアウトを作成できます。

于 2010-05-26T17:41:05.903 に答える
0

直面している問題のスクリーンショットを見せてください。XMlレイアウトから、線形レイアウトで高さをfill_parentとしてリストを追加し、次にテキストビューを追加してからImageViewを追加したことがわかります。これは問題を引き起こす可能性がありますが、表示しているデータが表示された画面が表示されるまで、変更を加える正確なポイントを提供することはできません。

于 2010-04-01T13:25:30.523 に答える