- Forum-Beiträge: 28
17.04.2018, 15:59:09 via Website
17.04.2018 15:59:09 via Website
Guten Tag!
ich habe eine Activity in der ich
1) einen horizontal, zentrierten Titel oben haben möchte
2) darunter einen Text linksbündig und rechts neben dem Text ein Button.
Dafür habe ich 2 verschachtelte LinearLayouts, eins Horizontal und für die zweite Zeile ein vertikal Layout.
Ich schaffe es einfach nicht, dass der Titel erscheint. Ich sehe immer nur die Zeile mit dem Textview und dem Button.
Kann mit jemand sagen, was ich falsch mache?
Danke im Voraus,
Das Layout sieht so aus:
<?xml version="1.0" encoding="utf-8"?>
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".smi_controlActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">
<EditText
android:id="@+id/txtConnectedWith"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="Titel"
android:textSize="12sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingTop="60dp">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_weight="1"
android:text="Bitte hier ein Cmd eingeben" />
<Button
android:id="@+id/btSendCmd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_weight="1"
android:text="Button" />
</LinearLayout>
</LinearLayout>
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.