<TableRow >
        <LinearLayout >
             <RadioGroup
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
          android:orientation="horizontal">
            <RadioButton 
                android:id="@+id/f"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                androdi:text="@string/nan"/>
            <RadioButton 
                android:id="@+id/m"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/nv"/>
        </RadioGroup>
            
        </LinearLayout>
       
    </TableRow>

解决方案 »

  1. <?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="horizontal" >
        <TableLayout 
            android:layout_width="match_parent"
         android:layout_height="match_parent"
            android:stretchColumns="1">
        
        <TableRow >
            <RelativeLayout >
                  <TextView 
                      android:id="@+id/tv"
                   android:layout_width="50dp"
                android:layout_height="30dp"
                 android:text="用户名:"
                />
            
            <EditText 
                android:id="@+id/et"
                android:layout_toRightOf="@id/tv"
                android:layout_width="150dp"
                android:layout_height="wrap_content"
                />
                
            </RelativeLayout>
          
             
        </TableRow>
        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"
            android:background="#cccccc"/>
        <TableRow >
            <RelativeLayout >
                 <TextView
                android:id="@+id/tv1"  
      android:layout_width="50dp"
                android:layout_height="30dp"
                 android:text="密码:"
                />
            <EditText 
                android:inputType="textPassword"
                android:id="@+id/et1"
                android:layout_width="150dp"
                android:layout_height="wrap_content"
                 android:layout_toRightOf="@id/tv1"
               /> 
            </RelativeLayout>
           
        </TableRow>
        <View 
            android:layout_width="fill_parent"
            android:layout_height="1dp"
            android:background="#cccccc"/>    <TableRow >
            <LinearLayou>
                 <RadioGroup
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
              android:orientation="horizontal"
              >
                <RadioButton 
                    android:id="@+id/f"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    androdi:text="@string/nan"/>
                <RadioButton 
                    android:id="@+id/m"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/nv"/>
            </RadioGroup>
                
            </LinearLayout>
           
        </TableRow>
        <TableRow>
            <Button 
                android:id="@+id/btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="注册"
                android:layout_gravity="center"/>
        </TableRow>
        
            
        </TableLayout>
        
    </LinearLayout>
    这是整个的XLM文件
      

  2. <?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="horizontal">
    <TableLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:stretchColumns="1">
    <TableRow>
    <RelativeLayout>
    <TextView
    android:id="@+id/tv"
    android:layout_width="50dp"
    android:layout_height="30dp"
    android:text="用户名:" />
    <EditText
    android:id="@+id/et"
    android:layout_toRightOf="@id/tv"
    android:layout_width="150dp"
    android:layout_height="wrap_content" />
    </RelativeLayout>
    </TableRow>
    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#cccccc" />
    <TableRow>
    <RelativeLayout>
    <TextView
    android:id="@+id/tv1"
    android:layout_width="50dp"
    android:layout_height="30dp"
    android:text="密码:" />
    <EditText
    android:inputType="textPassword"
    android:id="@+id/et1"
    android:layout_width="150dp"
    android:layout_height="wrap_content"
    android:layout_toRightOf="@id/tv1" />
    </RelativeLayout>
    </TableRow>
    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#cccccc" />
    <TableRow>
    <LinearLayou>
    <RadioGroup
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <RadioButton
    android:id="@+id/f"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/nan" />
    <RadioButton
    android:id="@+id/m"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/nv" />
    </RadioGroup>
    </LinearLayou>
    </TableRow>
    <TableRow>
    <Button
    android:id="@+id/btn"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="注册"
    android:layout_gravity="center" />
    </TableRow>
    </TableLayout>
    </LinearLayout>
      

  3. android拼写错误,标签结束位置错误
      

类似问题 »