Buttons nebeneinander anordnen?

  • Antworten:2
Pulver Toastmann
  • Forum-Beiträge: 2

17.02.2012, 13:30:01 via Website

Hi,
ich möchte für meine App in Interface mit 5 Buttons machen.
Die Buttons sollen so angeordnet sein:



Jedoch schaffe ich es nicht die so anzuordnen.
Kann mir Jemand vielleicht helfen?
Gruss

Hier noch mein aktueller Code:
1<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 android:layout_width="wrap_content"
4 android:layout_height="wrap_content"
5 android:baselineAligned="false"
6 android:orientation="horizontal"
7 android:padding="10dip" >
8
9 <Button
10 android:id="@+id/button1"
11 android:layout_width="wrap_content"
12 android:layout_height="wrap_content"
13 android:layout_marginTop="90dp"
14 android:onClick="LeftButton"
15 android:text="@string/Left" />
16
17 <Button
18 android:id="@+id/buttonSend"
19 android:layout_width="68dp"
20 android:layout_height="wrap_content"
21 android:layout_marginTop="38dp"
22 android:onClick="ForwardButton"
23 android:text="@string/Forward" />
24
25 <Button
26 android:id="@+id/button2"
27 android:layout_width="wrap_content"
28 android:layout_height="wrap_content"
29 android:layout_marginTop="90dp"
30 android:onClick="RightButton"
31 android:text="@string/Right" />
32
33 <Button
34 android:id="@+id/button3"
35 android:layout_width="wrap_content"
36 android:layout_height="wrap_content"
37 android:layout_marginTop="140dp"
38 android:onClick="BackwardButton"
39 android:text="@string/Back" />
40
41 <Button
42 android:id="@+id/button4"
43 android:layout_width="wrap_content"
44 android:layout_height="wrap_content"
45 android:text="@string/Cancel" />
46
47 <RelativeLayout
48 android:id="@+id/editPanel"
49 android:layout_width="0dp"
50 android:layout_height="wrap_content"
51 android:layout_alignParentTop="true"
52 android:layout_weight="0.01"
53 android:gravity="center" >
54
55 </RelativeLayout>
56
57</LinearLayout>

Antworten
Florian B.
  • Forum-Beiträge: 284

17.02.2012, 14:00:25 via Website

RelativeLayout heißt das Zauberwort! ;)

Antworten
San Blarnoi
  • Forum-Beiträge: 2.545

17.02.2012, 21:27:56 via Website

...oder TableLayout, was in diesem Fall wohl die einfachste Lösung sein dürfte.

Antworten