Я пытаюсь создать макет в android, когда создаю линейный макет внутри линейного макета, добавляя его, но не видя в интерфейсе. вот мой кодЛинейная компоновка внутри макета Lineary в android
<?xml version="1.0" encoding="utf-8"?>
<!-- Parent linear layout with vertical orientation -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="_baseline"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip"
android:text="@string/name" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_marginTop="0dp"
android:ems="10" >
<requestFocus />
</EditText>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="290dp"
android:text="@string/submit" />
<!-- Child linear layout with horizontal orientation -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#2a2a2a"
android:baselineAligned="_baseline"
android:orientation="horizontal" >
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="Previous" android:padding="15dip" android:layout_weight="1"
android:gravity="center"/>
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content"
android:text="Next" android:padding="15dip" android:layout_weight="1"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
Там нет места для него, ваш 'EditText' и' Button' являются 'match_parent' так толкая все из. –
андроид: ориентация = «горизонтальная», у вашего родительского макета есть это свойство. измените его на вертикальный –
Спасибо за ответ Ken, я сделал это изменение, но все же его не видно. – Sajeetharan