Meine ListView
besteht aus drei TextViews
, sagen T1, T2 und T3. Ich habe auch zwei Tasten, B1 und B2ListView mit TextView und Tasten
ich sie wie folgt angezeigt werden soll:
B1 [Space Between Tasten] B2
T1
T2
T3
Die T1 usw. sind auf dem Bildschirm unter den Tasten und nicht nur unter B1.
Unten ist meine XML, die ich nach vielen Antworten auf SO Fragen zu ändern versuchte.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Left Button"
/>
<Button
android:id="@+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:text="Right Button"
/>
</LinearLayout>
<TextView
android:id="@+id/engText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10sp"
android:textSize="15sp"
android:typeface="serif"/>
<TextView
android:id="@+id/arabText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10sp"
android:textSize="15sp"
android:typeface="sans"
/>
<TextView
android:id="@+id/refText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10sp"
android:textSize="15sp" />
<ListView
android:id="@+id/hadithView"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</RelativeLayout>
Kann jemand bitte helfen. Danke
EDIT ich CursorAdapter
bin mit den Ansichten zu füllen. Die B1 und B2 werden mit TextViews
wiederholt. Ich mag B1 und B2 an der Spitze halten (fest) und in der Lage, die Textansichten blättern (ohne eigene Tasten)
EDIT 2 ich das Buttons Problem behoben. Obwohl ich auch oben zwei Knöpfe brauche. Ich habe sie entfernt und habe jetzt zwei Buttons mit Textansichten, was ich später sowieso brauche.
Jetzt Der Text wird sich gegenseitig auferlegt.
Hier ist meine neue xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/button"
android:layout_width="0sp"
android:layout_weight="0.5"
android:layout_height="wrap_content"
android:text="Left Button" />
<Button
android:id="@+id/button2"
android:layout_width="0sp"
android:layout_weight="0.5"
android:layout_height="wrap_content"
android:text="Right Button" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/engText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10sp"
android:textSize="15sp"
android:typeface="serif"/>
<TextView
android:id="@+id/arabText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10sp"
android:textSize="15sp"
android:typeface="sans"
/>
<TextView
android:id="@+id/refText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10sp"
android:textSize="15sp" />
</RelativeLayout>
</LinearLayout>
Vielen Dank für Ihre Antwort. Dies funktioniert teilweise. Schaltflächen werden mit Textansichten wiederholt und zwei bleiben oben (fixiert). Im Moment möchte ich nur die ersten zwei Knöpfe haben. Bitte beachten Sie meine EDIT zu OP –
vielleicht sollten Sie darüber nachdenken, die Symbolleiste zu verwenden, um Sachen zu tun, die immer oben fixiert ist? Wenn nicht, dann kann Ihnen vielleicht ein explicit ScollView helfen. – deadpoint
:) Ich komme aus 'WebView'. Meine App war fast fertig, aber 'WebView' zeigte einen Defekt (zu langsam um große HTML Daten zu laden). Also kam ich zu 'Listview' und hoffte, dass es schneller geht. Es ist meine erste App. Lassen Sie sehen, wie diese Ansicht geht. Vielen Dank für Ihre Vorschläge:) –