2017-05-23 8 views
0

こんにちは、私はエミュレータに私のアプリを展開しようとするたびに、現在、このメッセージを持って、私は活動にレイアウトを取り付ける場所を正確にそれが起こっすなわちジャワ、Lang.OutOfMemoryError XamarinのAndroid展開

SetContentView(Resource.Layout.Main); 

完全なエラーメッセージは、「OOMまで、6569942バイト1048576空きバイトと割り当てと95を割り当てることができませんでしたと言い

ここに私のレイアウトです:。

<?xml version="1.0" encoding="utf-8"?> 
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http//schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/coordLayout" 
    tools:context=".MainActivity"> 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 
      <ImageView 
       android:layout_marginTop="40sp" 
       android:id="@+id/logo" 
       android:layout_width="200sp" 
       android:layout_height="200sp" 
       android:src="@drawable/cpdep" 
       android:layout_gravity="center_horizontal" /> 
      <EditText 
       android:id="@+id/user" 
       android:layout_marginTop="20sp" 
       android:layout_gravity="center_horizontal" 
       android:layout_width="300sp" 
       android:layout_height="wrap_content" 
       android:hint="Username" /> 
      <EditText 
       android:id="@+id/pass" 
       android:layout_gravity="center_horizontal" 
       android:layout_width="300sp" 
       android:layout_height="wrap_content" 
       android:hint="Password" 
       android:layout_marginTop="20sp" /> 
      <Button 
       android:layout_marginTop="20sp" 
       android:layout_marginRight="40sp" 
       android:id="@+id/myButton" 
       android:layout_width="100sp" 
       android:layout_height="wrap_content" 
       android:text="Log in" 
       android:layout_gravity="right" /> 
    </LinearLayout> 
</android.support.design.widget.CoordinatorLayout> 

あなたはありますかこれをどのように解決するのか?あなたの助けを前もって感謝してください

+1

レイアウトはどうなっていますか?これを示す元の投稿を更新できますか? – apineda

+0

もちろんこれが助けになる場合 – Geeksan

+1

textSize(存在する場合)を除いて "sp"を "dp"に更新しようとしますか? 200dpの幅と200dpの高さを持つImageViewがあると言われています。 – apineda

答えて

1

私はレイアウトに使用する画像のサイズのために何がうまくいかなかったのか理解します。解像度は6200x6199で2.89MBでした。私はPhotoshopでサイズを変更し、@apenideのおかげですべてが正常に動作しています

関連する問題