5

ここでの非常に特有の問題、単に背景画像アセットはギャラクシーネクサスを除くすべての電話でうまく表示されます(または私はこれまでに見つけました)

複数の異なる電話でアプリのギャラリーの下を見つけますが、画像番号SIXで、ネクサスに背景がないことに注意してください。

すべての密度と大きい+XL画面サイズのサポートを設定しました。1つのレイアウトのXMLを投稿しますが、コントロールや線形レイアウトなど、すべてのレイアウトにまたがっています。

画像: http: //goo.gl/59c8C

<?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent" android:background="@drawable/app_bg">

     <ScrollView
         android:id="@+id/scrollView12"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent" android:layout_alignParentBottom="true" android:fillViewport="true">

         <RelativeLayout
             android:layout_width="match_parent"
             android:layout_height="match_parent" >

                 <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical" android:layout_alignParentBottom="true">


             <com.quickcontact.CustomTextView
                 android:id="@+id/CustomTextView01"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="10dp"
                 android:gravity="center"
                 android:text="Tap the buttons below to create your contact profiles. You will be able to assign contact details to each of your profiles and share them with others."
                 android:textColor="#3f3f3f"
                 android:textSize="15sp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_gravity="center_horizontal"/>

             <com.quickcontact.CustomTextView
                 android:id="@+id/receiveHeadertxt"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="20dp"
                 android:gravity="center"
                 android:text="-- Create Profile --"
                 android:textColor="#3f3f3f"
                 android:textSize="15sp" android:layout_gravity="center_horizontal"/>

             <com.quickcontact.CustomButton
                 android:id="@+id/butPersonal"
                 android:layout_width="match_parent"
                 android:layout_height="78dp"
                 android:background="@drawable/standard_button"
                 android:padding="1dp"
                 android:text="Personal"
                 android:textColor="#3f3f3f"
                 android:textSize="16sp" />

             <com.quickcontact.CustomButton
                 android:id="@+id/butSocial"
                 android:layout_width="match_parent"
                 android:layout_height="78dp"
                 android:layout_marginTop="5dp"
                 android:background="@drawable/standard_button"
                 android:padding="1dp"
                 android:text="Social"
                 android:textColor="#3f3f3f"
                 android:textSize="16sp" />

             <com.quickcontact.CustomButton
                 android:id="@+id/butBusiness"
                 android:layout_width="match_parent"
                 android:layout_height="78dp"
                 android:layout_marginTop="5dp"
                 android:background="@drawable/standard_button"
                 android:padding="1dp"
                 android:text="Business"
                 android:textColor="#3f3f3f"
                 android:textSize="16sp" android:layout_marginBottom="20dp"/>

             <com.quickcontact.CustomButton
                 android:id="@+id/butNext"
                 android:layout_width="fill_parent"
                 android:layout_height="58dp"
                 android:background="@drawable/blue_button"
                 android:gravity="center_vertical|center_horizontal"
                 android:paddingBottom="1dp"
                 android:text="NEXT"
                 android:textColor="#3f3f3f"
                 android:textSize="16sp" />

         </LinearLayout>

         </RelativeLayout>

     </ScrollView>

 </RelativeLayout>
4

1 に答える 1

6

GalaxyNexusはxhdpiデバイスです。背景画像は/res/drawable-xhdpi/ディレクトリにありますか?

別のオプションとして、背景がグラデーションの場合は、xmlでグラデーションスクリプトを記述し、それを/res/layout/app_bg.xml:に配置することができます。

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

<item>
    <shape>
        <gradient
            android:startColor="@color/green2"
            android:endColor="@color/green1"
            android:gradientRadius="555"
            android:type="radial" />
    </shape>
</item>
</selector>

次に、あなたの背景を次のように参照しますandroid:background="@layout/app_bg"

私の好みは、アプリ全体で一貫したスタイルの単一のレイアウトスタイルxmlを作成し、それを他のすべてのxmlレイアウトに含めることです。

于 2012-05-31T15:30:39.420 に答える