- Forum-Beiträge: 24
20.03.2017, 09:16:14 via Website
20.03.2017 09:16:14 via Website
Hallo zusammen,
ich suche das richtige Layout für ein Formular, in dem ich in mehreren Zeilen mehrere Werte eingeben kann. Dabei sollte jeweils das Wertelabel links von der EditView stehen.
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="6dp"
tools:context="com.example.calculator.CalculatorMainActivity">
<TextView
android:id="@+id/location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:visibility="visible"
android:padding="8dp"
tools:text="@string/location" />
<EditView
android:id="@+id/locationValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:padding="8dp"
tools:text="@string/locationValue" />
<TextView
android:id="@+id/projectLocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:visibility="visible"
android:padding="8dp"
/>
<EditView
android:id="@+id/projectLocationValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
android:padding="8dp"/>
<Button
android:id="@+id/calculate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"/>
Dieses Beispiel schreibt jede View in eine eigene Zeile. Dagegen mit "android:orientation="horizontal"" werden alle Views nacheinander in einer Zeile abgelegt.
Kann das das LinearLayout überhaupt und wenn ja, wie? Oder gibt es dafür ein anderes Layout?
Zusätzlich würde mich interessieren wie in Android JComboBox heißen?
Grüße
Linuxmaker
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.