現在Androidの入門書を読み進めているのですが詰まったので質問させて下さい
最初にViewSampleプロジェクトを作り、res/layoutディレクトリ内のviewsample.xmlに下記のコードを書きましたところ、9行目 xmlns:android="http://schemas.android.com/apk/res/android"
で、Unexpected namespace prefix "xmlns" found for tag LinearLayoutというエラーが出てしまいます。
何度も本と照らし合わせているのですがコードの間違いではなさそうです
それと、viewsample.xml以外は弄っていないのですが、src/exsample.android.viewsampleディレクトリ内のViewSample,javaにも赤xのエラー
Rを変数に解決できませんというエラーがでてしまいます
解決方法はありますでしょうか?
lang
1<!-- 画面全体のスクロールバーの追加 --> 2<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 3 android:orientation="vertical" 4 android:layout_width="fill_parent" 5 android:layout_height="fill_parent"> 6 <!-- レイアウトの定義 --> 7 <LinearLayout 8 xmlns:android="http://schemas.android.com/apk/res/android" 9 android:orientation="vertical"> 10 android:layout_width="fill_parent" 11 android:layout_height="wrap_content"> 12 13 <!-- TextViewの定義 --> 14 <TextView 15 android:layout_width="fill_parent" 16 android:layout_height="wrap_content" 17 android:layout_marginTop="5dp" 18 android:layout_marginBottom="5dp" 19 android:text="@string/textviewsample1" /> 20 21 <!-- テキストボックスの定義 --> 22 <CheckBox android:id="@+id/edittext" 23 android:layout_width="fill_parent" 24 android:layout_height="wrap_content" /> 25 26 <!-- CheckBoxの定義 --> 27 <CheckBox android:id="@+id/checkbox1" 28 android:paddingBottom="24sp" 29 android:paddingTop="24sp" 30 android:layout_width="wrap_content" 31 android:layout_height="wrap_content" 32 android:text="@string/checkboxsample2" /> 33 34 <CheckBox android:id="@+id/checkbox2" 35 android:layout_width="wrap_content" 36 android:layout_height="wrap_content" 37 android:text="@string/checkboxsample2" /> 38 39 <!-- RadioButtonの定義 --> 40 <RadioGroop 41 android:layout_width="fill_parent" 42 android:layout_height="wrap_content" 43 android:orientation="vertical"> 44 45 <RadioButton android:id="@+id/radiobutton1" 46 android:layout_width="wrap_content" 47 android:layout_height="wrap_content" 48 android:text="@string/radiobuttonsample1" /> 49 50 <RadioButton android:id="@+id/radiobutton2" 51 android:layout_width="wrap_content" 52 android:height="wrap_content" 53 android:text="@string/radiobuttonsample2" /> 54 55</RadioGroop> 56 57 <!-- Spinnerの定義 --> 58 <Spinner android:id="@+id/spinner1" 59 android:layout_width="fill_parent" 60 android:layout_height="wrap_content" 61 android:entries="@array/list_name" 62 android:drawSelectorOnTop="true" /> 63 64 <!-- ListViewの定義 --> 65 <ListView android:id="@+id/listView1" 66 android:paddingBottom="24sp" 67 android:paddingTop="24sp" 68 android:layout_width="fill_parent" 69 android:layout_height="250dp" 70 android:entries="@array/list_name" /> 71 72 <!-- ボタンの定義 --> 73 <Button android:id="@+id/button1" 74 android:layout_width="wrap_content" 75 android:layout_height="wrap_content" 76 android:text="@string/buttonsample1" /> 77 78</LinearLayout> 79</ScrollView> 80コード
どうぞよろしくお願いします
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。