Meine App macht Protokollierung und der Benutzer könnte es für Tage laufen lassen. In diesem Fall könnte ich am Ende 100k Textzeilen haben, durch die man scrollen konnte.Scrollview - TextView Grenzen in Bezug auf die Anzahl der Zeilen
Das scheint nicht vernünftig. Ich sollte einige Speicherlimits sehen. Wie viele Textzeilen würden Sie maximal beibehalten?
Können Sie eine rollende Textansicht haben, die die letzten 1 k Zeilen Text beibehalten würde? Soll ich es nur mit einem Textview mit einer Maxline von 1k und Scrollbalken machen?
Im Moment habe ich die folgende xml haben:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.narb.log.MainActivity">
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Start"
/>
<ScrollView
android:id="@+id/sv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:layout_below="@id/btn"
>
<TextView
android:id="@+id/txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="This is the log number"
android:layout_margin="15dp"
/>
</ScrollView>
</RelativeLayout>