2012-05-31 5 views
5

매우 특이한 문제는 단순히 갤럭시 넥서스를 제외한 모든 휴대 전화에서 배경 이미지 애셋이 잘 표시됩니다 (또는 지금까지 찾았습니다)Galaxy Nexus (배경)에 배경 이미지가 표시되지 않습니까?

여러 휴대 전화에서 앱 갤러리를 아래에서 찾으세요. number 6 넥서스에는 배경이 없습니다.

모든 밀도 및 대형 XL 화면 크기에 대한 지원을 설정 했으므로 컨트롤 레이아웃/선형 레이아웃 또는 그 밖의 모든 레이아웃이 있는지 여부에 관계없이 모든 레이아웃에서 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> 

답변

6

갤럭시 넥서스는 xhdpi 장치이다. 배경 이미지가 /res/drawable-xhdpi/ 디렉토리에 있습니까?

또 다른 옵션은, 당신의 배경 단지 기울기 당신은 XML로 그라데이션 스크립트를 작성할 수 있고 단지에 배치 할 경우 /res/layout/app_bg.xml : android:background="@layout/app_bg"

내 취향대로

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

그런 다음 배경을 참조 앱 전체에서 일관된 스타일을위한 하나의 레이아웃 스타일 xml을 만든 다음 다른 모든 xml 레이아웃에 포함 시키십시오.

+0

멋진 직장! :) thanks – Broak

+1

나는 이것이 정말로 오래된 질문이라는 것을 알고있다. 어쨌든, 문제는 여전히 여기 있습니다 ... 이것은 훌륭한 해결 방법입니다. 당신이 제공하는 솔루션은 완벽하게 작동합니다. 제 경우에는 복잡한 그라디언트 (multi-directionnal ... 등)를 사용하기 때문에 그림을 사용하는 것이 훨씬 쉬울 것입니다 ... 그래서 문제가 어디서 발생하는지 모르겠습니다. 내 리소스는 xhdpi 폴더에 있습니다 ... 다른 단서가 있습니까? – mithrop

+1

또한 삼성 Nexus에서 같은 문제가 발생하고 일부 RelativeLayouts에 대해서는 배경 이미지를 볼 수 없으며 배경 이미지는 드로어 블 폴더에 있습니다. 나는 xml 모양으로 해답을 주어진 모양으로 시도했지만 모양이 아닌 배경으로 사용했다. 누군가가 그 문제를 발견하면 알려주기 바란다. – User7723337

관련 문제