Android-App Mit TextView in eine ScrollView
Ich versuche zur Implementierung einer android-app. Ich habe Probleme mit TextView in eine ScrollView. Wenn ich Schreibe einen text in TextView entsprechend seiner Länge einige Zeilen des Textes oben nicht gesehen werden können. Ich denke, Sie sind occuluded mit anderen Dingen, die sich in der Spitze. Hier ist meine xml Datei.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RadioGroup
android:id="@+id/RadioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/SayisalRadioButton"
android:layout_width="158dp"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/SayisalLoto" />
<RadioButton
android:id="@+id/SuperLotoRadioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/SuperLoto" />
</RadioGroup>
<TableRow
android:id="@+id/KolonSayisiTableRow"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/KolonSayisiEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@string/KolonSayisiHint"
android:inputType="number"
android:text="@string/Bos" >
<requestFocus />
</EditText>
<Button
android:id="@+id/SallaButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Uret" />
<ProgressBar
android:id="@+id/SonucProgressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:visibility="invisible" />
</TableRow>
<ScrollView
android:id="@+id/SonucScrollView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center" >
<TextView
android:id="@+id/SonucTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:editable="false"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:text="@string/Bos"
android:textAppearance="?android:attr/textAppearanceMedium" />
</ScrollView>
</LinearLayout>
Zum Beispiel wenn ich einen text mit mehreren Zeilen in die TextView mit der ID : SonucTextView je nach Größe, ich kann nicht sehen, einige Teile des Textes an der Spitze. Wie kann ich dieses problem lösen? Ist es bezogen auf das layout, dass ich verwende?
Du musst angemeldet sein, um einen Kommentar abzugeben.
Ihre Frage ist in Bezug auf diese eine. Also ich schlage vor, Sie überprüfen Sie heraus die akzeptierte Antwort.
Diese Antwort besagt, dass alle Sie tun müssen ist, legen Sie die maximale Anzahl von Zeilen, die Sie möchten anzeigen, und geben Sie ihm eine scrollbar so wie hier:
Und dann gehen Sie zur Einstellung der Veranstaltung in den code :
Möchte ich hinzufügen, dass der ScrollView widget verwendet werden, wenn Sie möchten, dass Ihre gesamte Ansicht zu scrollen, nicht ein einzelnes widget.
Hoffe, das hilft!
Probieren Sie es aus:
Wenn du wrap_content Sie nicht haben, können Größe zu scrollen es.
Beste Weg,