2016-04-22 27 views
0

私はアンドロイド(xamarinを使って)の主な活動の背景画像を設定しようとしました。イメージはデザインに表示されますが、私の携帯電話にエミュレートすると(Galaxy S4)は表示されません。ここにコードがあります。ここで何が間違っていますか?背景画像android xamarin

 <?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"> 
    <ImageView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:src="@drawable/home" 
     android:scaleType="fitXY" /> 
    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
     <GridLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:columnCount="1" 
      android:layout_gravity="bottom" 
      android:minHeight="250dp"> 
      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal" 
       android:minHeight="125dp"> 
       <Space 
        android:layout_width="wrap_content" 
        android:layout_height="match_parent" 
        android:layout_weight="1" /> 
       <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Button 1" 
        android:layout_gravity="center" /> 
       <Space 
        android:layout_width="wrap_content" 
        android:layout_height="match_parent" 
        android:layout_weight="1" /> 
       <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:text="Button 2" /> 
       <Space 
        android:layout_width="wrap_content" 
        android:layout_height="match_parent" 
        android:layout_weight="1" /> 
      </LinearLayout> 
      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal" 
       android:minHeight="125dp"> 
       <Space 
        android:layout_width="wrap_content" 
        android:layout_height="match_parent" 
        android:layout_weight="1" /> 
       <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Button 3" 
        android:layout_gravity="center" /> 
       <Space 
        android:layout_width="wrap_content" 
        android:layout_height="match_parent" 
        android:layout_weight="1" /> 
       <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_gravity="center" 
        android:text="Button 4" /> 
       <Space 
        android:layout_width="wrap_content" 
        android:layout_height="match_parent" 
        android:layout_weight="1" /> 
      </LinearLayout> 
     </GridLayout> 
    </LinearLayout> 
</RelativeLayout> 

答えて

2

多分大きいかもしれません。このようなエラーのコンソールに表示:テクスチャにアップロードすることがビットマップが大きすぎる(4350x2448、最大= 4096x4096)

描画可能nodpi

Android background image memory usage

+0

に画像を配置しようとすると、私は視覚的な使用していますこのアンドロイドプロジェクトのスタジオ2015は、私は解決策では "drawable-nodpi"というフォルダを持っていません。私はフォルダ "drawable"しか持っていません。私は小さな画像(720x1280)で試しましたが、これは(1080x1920)で動作しているためです。それは画像の解像度に関連しますが、どのようにすべての画面に合わせて変更できますか?ありがとう – CalinCosmin

+0

このフォルダをResourcesフォルダ内のあなたのソリューションに追加することができます: – iwanlenin

+0

私もこれを試しましたが、それらの間を切り替えることはできません。 – CalinCosmin