Hallo World Workshop Button Platzieren

  • Antworten:2
  • Bentwortet
Dirk Unverzagt
  • Forum-Beiträge: 13

11.12.2010, 08:24:20 via Website

Hi,
ich arbeite gerade das https://www.nextpit.de/de/android/wiki/view/Android_Anfänger_Workshop
Im Workshop sind die beiden Buttons neben einander. Bei Mir stehen sie aber untereinander :(
Kann mir da jemand auf die sprünge helfen ?


Mein Code sieht so aus:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/enter_your_name"
/>
<EditText
android:id="@+id/name_field"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/hi_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/hi_button"
/>
<Button
android:id="@+id/hello_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/hello_button"
/>
</LinearLayout>

mfg Dirk

Antworten
Mac Systems
  • Forum-Beiträge: 1.727

11.12.2010, 10:45:46 via Website

Was logisch ist: android:orientation="vertical" wird im Layout angegeben.

Windmate HD, See you @ IO 14 , Worked on Wundercar, Glass V3, LG G Watch, Moto 360, Android TV

Antworten
Dirk Unverzagt
  • Forum-Beiträge: 13

11.12.2010, 14:18:19 via Website

Hi,

Mir war die verschachtelung von LinearLayout nicht kla.

so ging es nicht:
1<LinearLayout ... >
2 ...
3 </LinearLayout>
4<LinearLayout ... >
5 ...
6 </LinearLayout>


aber so geht es:
1<LinearLayout ... >
2 ...
3 <LinearLayout ... >
4 ...
5 </LinearLayout>
6 </LinearLayout>


Grüße und gute Gedanken
Dirk

Antworten