0

私のアプリには、xhdpi デバイス用のスプラッシュ スクリーン (ステータス バー用に 1230x720 50px) が含まれています。samsung galaxy s2、s3 では、スプラッシュ イメージが画面全体に表示され、見栄えがよくなります。ただし、Galaxy nexus では、ナビゲーション バーの高さが 90 ~ 100px のようで、スプラッシュ画像が細くなりすぎます。これらのデバイスはすべて xhdpi であるため、Galaxy nexus の完全なスプラッシュ イメージを表示するにはどうすればよいですか?

いくつかの選択肢を考えました。1 - SYSTEM_UI_FLAG_HIDE_NAVIGATION フラグはいくつかの回避策で確実に機能しますが、私のアプリは 2.3.4 で実行されているため、フラグが見つかりません。

2- 現在の画像はそれほど悪くありませんが、少なくともスプラッシュ スクリーンの中央に配置できれば問題ありません。

ありがとうございました。

編集:スプラッシュスクリーン用の私のxmlは次のとおりです

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

     <ImageView android:id="@+id/splash_image_view"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_gravity="top"
          android:scaleType="fitStart"
          android:gravity="top"/>

     <ProgressBar android:id="@+id/progressBar"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal|top"
          android:progress="0"
          style="?android:attr/progressBarStyleHorizontal" />     
</FrameLayout>

答え:

API ドキュメントにアクセスし、SYSTEM_UI_FLAG_HIDE_NAVIGATION フラグの代わりにハードコードされた int 値を使用して、それを理解しました。

コードは 0x2 です (2)

4

1 に答える 1

0

OPの編集によると:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

     <ImageView android:id="@+id/splash_image_view"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_gravity="top"
          android:scaleType="fitStart"
          android:gravity="top"/>

     <ProgressBar android:id="@+id/progressBar"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="center_horizontal|top"
          android:progress="0"
          style="?android:attr/progressBarStyleHorizontal" />     
</FrameLayout>
于 2012-07-22T23:51:35.387 に答える