2015-03-14 4 views
0

Я новичок в приложении для Android. Привет! Ошибка компиляции, когда я кодирую файл XML. Может ли кто-нибудь помочь мне, что не так? Самый внешний Linearlayout продолжает жаловаться.Неправильная ориентация

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout     **// This LinearLayout keep complaining** 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:weightSum="10" 
    android:orienation="vertical"> 

    <!-- Radio Group on the top --> 
    <RadioGroup 
     android:id="@+id/rg" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:weightSum="3" 
     android:background="#3BE5FF"> 

     <RadioButton 
      android:id="@+id/rbt3" 
      android:layout_weight="1" 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_marginRight="0.5dp" 
      android:layout_marginBottom="0.5dp" 
      android:background="#ffffff" 
      android:gravity="center" 
      android:checked="true" /> 

     <RadioButton 
      android:id="@+id/rbt2" 
      android:layout_weight="1" 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_marginRight="0.5dp" 
      android:layout_marginBottom="0.5dp" 
      android:background="#ffffff" 
      android:gravity="center"/> 

     <RadioButton 
      android:id="@+id/rbt1" 
      android:layout_weight="1" 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_marginBottom="0.5dp" 
      android:background="#ffffff" 
      android:gravity="center"/> 
    </RadioGroup> 

    <!-- Input Window --> 
    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:weightSum="3" 
     android:background="#3BE5FF"> 

    </LinearLayout> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal" 
     android:weightSum="3" 
     android:background="#3BE5FF"> 

    </LinearLayout> 

</LinearLayout> 

Может ли кто-нибудь сказать мне, что не так?

+0

Привет, я вижу, вы новичок в SO. Если вы чувствуете, что ответ решил проблему, отметьте ее как «принятую», нажав зеленую галочку. Это помогает сосредоточиться на более старых SO, которые до сих пор не имеют ответов. – kkaosninja

ответ

1

вы неправильно указали ориентацию.

Изменить

android:orienation 

в

android:orientation 
1

Измените файл макета в одном нижеперечисленным

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:weightSum="10" 
android:orientation="vertical"> 

<!-- Radio Group on the top --> 
<RadioGroup 
    android:id="@+id/rg" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:weightSum="3" 
    android:background="#3BE5FF"> 

    <RadioButton 
     android:id="@+id/rbt3" 
     android:layout_weight="1" 
     android:layout_width="0dp" 
     android:layout_height="fill_parent" 
     android:layout_marginRight="0.5dp" 
     android:layout_marginBottom="0.5dp" 
     android:background="#ffffff" 
     android:gravity="center" 
     android:checked="true" /> 

    <RadioButton 
     android:id="@+id/rbt2" 
     android:layout_weight="1" 
     android:layout_width="0dp" 
     android:layout_height="fill_parent" 
     android:layout_marginRight="0.5dp" 
     android:layout_marginBottom="0.5dp" 
     android:background="#ffffff" 
     android:gravity="center"/> 

    <RadioButton 
     android:id="@+id/rbt1" 
     android:layout_weight="1" 
     android:layout_width="0dp" 
     android:layout_height="fill_parent" 
     android:layout_marginBottom="0.5dp" 
     android:background="#ffffff" 
     android:gravity="center"/> 
</RadioGroup> 

<!-- Input Window --> 
<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:weightSum="3" 
    android:background="#3BE5FF"> 

</LinearLayout> 

<LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:weightSum="3" 
    android:background="#3BE5FF"> 

</LinearLayout> 

Как уже упоминалось @Blackbelt, ориентация misspel светодиод.

Кроме того, вы пропустили атрибут xmlns: android для родительского LinearLayout.

Принятый ответ на этот пост SO объясняет свое значение =>What does "xmlns" in XML mean?

Смежные вопросы