アンドロイドのプログラミングについて

フォーラム(掲示板)ルール
フォーラム(掲示板)ルールはこちら  ※コードを貼り付ける場合は [code][/code] で囲って下さい。詳しくはこちら
mi_l

アンドロイドのプログラミングについて

#1

投稿記事 by mi_l » 13年前

現在、とある参考書を片手にアンドロイドのプログラミングを勉強しているのですが、なぜかエラーが出てしまうところがあり、非常に困っています

下記は、制作した送信フォームの中にあるラジオボタンについてのソースです
[andoroidpractice01.xml]

コード:

    <LinearLyout 
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
    >
    
    <TextView 
        android:text="性別:"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="5dp"
        android:layout_width="70sp"
        android:layout_height="wrap_content"
    />
    
    <RadioGroup 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
    >
    <RadioButton 
        android:id="@+id/male"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="男"
    />
    <RadioButton 
        android:id="@+id/female"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="女"
    />
    </RadioGroup>
   </LinearLayout>
このコードの最後(33行目)にバツ印がついていまして、マウスを持っていくと「要素タイプ "LinearLyout" は対応する終了タグ "</LinearLyout>" で終わらなければなりません。」と表示されます。
Eclipseでは、最後の"</LinearLyout>"をつけ忘れても、次の"<LinearLyout>"タグを作成しようと思っても"</LinearLyout>で終わる"的な感じで助けてくれます。
ですので、ほかの項目で最後に"</LinearLyout>"をつけ忘れたということはないと思うのですが・・・・

どこがおかしいかお願いします。理解はできてるのにここで止まっていて、ほかのフォームを試しに作ってラジオボタンを試してみましたがまたエラーが出ます。

下記は上記のコード(一部)を含むすべて

コード:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" 
>

    <TextView 
        android:text="お申し込みフォーム"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
    />
    
    <LinearLayout 
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
    >
    <TextView 
        android:text="お名前:"
        android:layout_width="70sp"
        android:layout_height="wrap_content"
    />
    <EditText 
        android:id="@+id/name"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
    />
    </LinearLayout>
    
    <LinearLayout 
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
    >
    <TextView 
        android:text="住所:"
        android:layout_width="70sp"
        android:layout_height="wrap_content"
    />
    <EditText 
        android:id="@+id/adress"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
    />
    </LinearLayout>
    
    <LinearLayout 
        android:orientation="hrizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_parent"
    >
    <TextView 
        android:text="生年月日"
        android:layout_width="70sp"
        android:layout_height="wrap_content"
    />
    <Spinner 
        android:id="@+id/month"
        android:entries="@array/month"
        android:layout_width="85dp"
        android:layout_height="wrap_content"
    />
    
    <TextView 
        android:text="月"
        android:layout_width="20sp"
        android:layout_height="wrap_content"
    />
    
    <Spinner 
        android:id="@+id/day"
        android:entries="@array/day"
        android:layout_width="85dp"
        android:layout_height="wrap_content"
    />
    
    <TextView 
        android:text="日"
        android:layout_width="20sp"
        android:layout_height="wrap_content"
    />
    </LinearLayout>
    
<!-- ーーーーーーーーーーーーーーーーーーーーーー 今回の質問箇所ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー-->
    <LinearLyout 
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
    >
    
    <TextView 
        android:text="性別:"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="5dp"
        android:layout_width="70sp"
        android:layout_height="wrap_content"
    />
    
    <RadioGroup 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
    >
    <RadioButton 
        android:id="@+id/male"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="男"
    />
    <RadioButton 
        android:id="@+id/female"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="女"
    />
    </RadioGroup>
    </LinearLyout>
    <!--  -ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー--->
    
    <LinearLayout 
        android:orientation="horizontal"
        android:background="#003399"
        android:layout_marginRight="50dp"
        android:layout_marginLeft="50dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    >
    <TextView 
        android:text="希望商品"
        android:layout_width="150sp"
        android:layout_height="wrap_content"
    />
    <TextView 
        android:text="注文数量"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    />
    </LinearLayout>
    
    <LinearLayout 
        android:orientation="horizontal"
        android:layout_marginRight="50"
        android:layout_marginLeft="50"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    >
    <CheckBox 
        android:layout_width="50dp"
        android:layout_height="wrap_content"
    />
    <TextView 
        android:text="リンゴ"
        android:layout_width="110sp"
        android:layout_height="wrap_content"
    />
    <EditText 
        android:id="@+id/apple"
        android:layout_width="50dp"
        android:layout_height="wrap_content"
    />    
    </LinearLayout>
    
    <LinearLayout 
        android:orientation="horizontal"
        android:layout_marginRight="50"
        android:layout_marginLeft="50"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    >
    <CheckBox 
        android:layout_width="50dp"
        android:layout_height="wrap_content"
    />
    <TextView 
        android:text="みかん"
        android:layout_width="110sp"
        android:layout_height="wrap_content"
    />
    <EditText 
        android:id="@+id/orange"
        android:layout_width="50dp"
        android:layout_height="wrap_content"
    />    
    </LinearLayout>
    
    <LinearLayout 
        android:orientation="horizontal"
        android:layout_marginRight="50"
        android:layout_marginLeft="50"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    >
    <CheckBox 
        android:layout_width="50dp"
        android:layout_height="wrap_content"
    />
    <TextView 
        android:text="モモ"
        android:layout_width="110sp"
        android:layout_height="wrap_content"
    />
    <EditText 
        android:id="@+id/peach"
        android:layout_width="50dp"
        android:layout_height="wrap_content"
    />    
    </LinearLayout>
    
    <Button 
       android:id="@+id/button01"
       android:layout_gravity="center_horizontal"
       android:layout_width="150"
       android:layout_height="wrap_content"
       android:text="送信" 
    />
 
</LinearLayout>
ご指摘お願いします。

かずま

Re: アンドロイドのプログラミングについて

#2

投稿記事 by かずま » 13年前

mi_l さんが書きました: 下記は、制作した送信フォームの中にあるラジオボタンについてのソースです
[andoroidpractice01.xml]

コード:

    <LinearLyout 
LinearLyout になっていますよ。

mi_l

Re: アンドロイドのプログラミングについて

#3

投稿記事 by mi_l » 13年前

なんと・・・・

ありがとうございます!!

閉鎖

“C言語何でも質問掲示板” へ戻る