0

My app contains splash screens (1230x720 50px for status bar) for xhdpi devices. On the samsung galaxy s2,s3, the splash image fills the entire screen and it looks good. However, on the galaxy nexus, the navigation bar seems to be 90-100px tall and the splash image becomes too skinny. Since all these devices are xhdpi, how do I work around showing the full splash image for the galaxy nexus?

I've thought about a couple options. 1 - the SYSTEM_UI_FLAG_HIDE_NAVIGATION flag would surely work with some workarounds, but my app is running off of 2.3.4 so the flag is not found.

2- The image currently is not that bad, but if I could atleast center it within the splash screen, then it would be fine.

thank you.

edit: here's my xml for the splash screen

<?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>

Answer:

I figured it out by going to the API documentation and using the hard-coded int value instead of the SYSTEM_UI_FLAG_HIDE_NAVIGATION flag.

the code is just 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 回答