Ich versuche, kleine Anwendung für Android zu entwickeln, die Benutzer Konzentration berechnet. Meine Idee ist es, eine Matrix von Bildern zu zeigen, in denen der Benutzer gezwungen ist, bestimmte Bilder in einer bestimmten Zeit auszuwählen und zu berechnen, wie genau der Benutzer war.GridView mit TextView in LinearLayout
Das Problem ist, dass ich nicht weiß, wie Sie ein Layout entwerfen, das TextViews und GridViews kombiniert.
Ich habe versucht, UI so zu machen, aber ich war nicht erfolgreich.
Ich dachte, dass es ausreicht, TextView1 in LinearLayout, dann GridView1, TextView2, GridView2 und Schaltfläche zu platzieren. Ich habe mehr Kombinationen ausprobiert, was zu meinem Versagen geführt hat.
Können Sie mir bitte einen Hinweis geben, wie Sie dieses Layout entwerfen können?
Das ist mein Layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:text="@+id/TextView01"
android:id="@+id/TextView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</TextView>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView android:id="@+id/ImageView01"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</ImageView>
<ImageView android:id="@+id/ImageView02"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</ImageView>
<ImageView android:id="@+id/ImageView03"
android:layout_width="wrap_content" android:layout_height="wrap_content">
</ImageView>
</LinearLayout>
<TextView android:text="@+id/TextView02"
android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.4">
<GridView android:id="@+id/GridView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numColumns="auto_fit"
android:columnWidth="25px"
android:stretchMode="none">
</GridView>
</LinearLayout>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button android:text="@+id/Button01"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:text="@+id/Button02"
android:id="@+id/Button02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
</LinearLayout>
Ich habe es geschafft, mehr Spalten in gridview haben und dort eine einzelne Zeile so viele Bilder zu bekommen, wie ich kann. Aber ich kann die Höhe einer Zeile nicht festlegen, nur die Breite einer Spalte. Bilder in der Gitteransicht werden vergrößert und ich kann keine Methode sehen, um sie auf ihre ursprüngliche Größe zu setzen.
Alles funktioniert außer der Gridview, die wie seltsam aussieht. Ich habe den ersten Post aktualisiert, wo ist mein Layout mit Bildschirm meines Android-Geräts. – nestor11
Sie sollten nicht füllen Eltern über die Gridview und horizontal denke ich – DroidAjax
Ich habe es geschafft, die Gridview zu setzen, um dort mehr Bilder in einer Zeile, aber diese Bilder haben nicht ihre Originalgröße. :-( – nestor11