3

アプリケーションをXoomタブレットで実行しようとしましたが、携帯電話とまったく同じサイズになりました(画面全体に表示されません)。

そこで、劣化した画像とプログレスバーを中央に表示する非常に単純なプロジェクトを作成しました。下の写真でわかるように、同じ結果が得られました。

Xoom-小さな画面http://raphaeu.com/gvt/Imagem.jpg

では、タブレットの画面全体を埋めるために、どのようにレイアウトを書き続けるのでしょうか。

これが私のマニフェストです:

<?xml version="1.0" encoding="utf-8"?>

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".MainActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>

これが私のmain.xmlレイアウトです:

<?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="@drawable/splash_portrait">

<ProgressBar 
    style="?android:progressBarStyle"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true" 
    android:layout_centerInParent="true"
/>

</RelativeLayout>

そして、これがプロジェクト全体です。ご覧になりたい場合は、http: //raphaeu.com/gvt/xoom.zipをご覧ください。

事前にどうもありがとうございました!!

4

2 に答える 2

4

これをマニフェストに追加します..

<supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:anyDensity="false" />

詳細はこちら... http://developer.android.com/guide/practices/screens-distribution.html

于 2011-06-17T13:13:19.627 に答える
0

高さと幅に「fill_parent」を使用するように xml レイアウトを調整してみてください。wrap_content を使用すると、使用可能な画面サイズに合わせて拡大するのではなく、必要なだけのスペースのみを占有するようにビューに指示します。

于 2011-06-17T13:14:43.343 に答える