の申し訳ありません。私のタイトルはStackOverFlow
の他の多くの人と似ていますが、それらの解決策のどれもが私の問題を満たしていないためです。Androidエラー:
私はレイアウトの使用を設計していますRelative Layout
。コードビューでのデザイン後、グラフィックビューに変更すると、Eclipseに通知されます。
layout_width属性を指定する必要があります。
layout_height属性を指定する必要があります。
。 java.lang.RuntimeException:私はこのプログラムを実行すると、LogCat
に起因でエラーに気づくでしょうバイナリXMLファイルのライン#2:あなた はlayout_width属性を指定する必要があります。ここで
私のXMLファイルです:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/contact_name"
android:text="Sam"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:textSize="20dp"/>
<TextView
android:id="@+id/contact_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10dp"
android:text="39256493"
android:layout_below="@+id/contact_name"
android:layout_alignLeft="@+id/contact_name"
android:layout_marginTop="5dp"/>
</RelativeLayout>
こと - これはあなたが持っている唯一のレイアウトXMLであります?他のものをチェックして、それらのエラーに該当しないことを確認します。 – jlindenbaum
私はこの同じエラーがあります。あなたのXMLレイアウトがうまく構成されていないと、このエラーが発生する可能性があります。私はレイアウトで無効なxmlタグを修正した後に働いた。 hth! –