- Forum-Beiträge: 184
01.11.2014, 19:15:07 via Website
01.11.2014 19:15:07 via Website
Hallo kann mir einer Von euch zeigen wie ich ein ScrollView auf eine bestimmte anzahl an EditTexten begrenzen kann. Es sollen z.B. nur 3 stück sein damit ich darunter noch einen Button und zwei TextViews Packen kann. Außerden sind obendrüber noch ein Button und nach dem Button noch ein ImageView. (Der Button und das ImageView nehmen die hälfte des Bildschirmes weg).
Mein xml Code bisher:
<?xml version="1.0" encoding="utf-8"?>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/app_name" >
<Button
android:id="@+id/button_Rechteck_Clear"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="@string/clear" />
<ImageView
android:id="@+id/iV_Rechteck"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:contentDescription="@string/app_name"
android:src="@drawable/rechteckform" />
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/iV_Rechteck"
android:layout_centerHorizontal="true"
android:fillViewport="true"
android:orientation="horizontal" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name" >
<EditText
android:id="@+id/editText_Rechteck_ZahlA"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/SeiteA"
android:inputType="numberDecimal" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/editText_Rechteck_ZahlB"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/editText_Rechteck_ZahlA"
android:ems="10"
android:hint="@string/SeiteB"
android:inputType="numberDecimal" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/editText_Rechteck_ZahlB"
android:ems="10"
android:inputType="numberDecimal" />
</RelativeLayout>
</ScrollView>
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/scrollView1"
android:layout_centerHorizontal="true"
android:text="Button" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/button1"
android:layout_centerHorizontal="true"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
Ein Fehler ist kein Fehler es ist ein Feature///https://play.google.com/store/apps/developer?id=Nimal+Development
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.