Mon application effectue une journalisation et l'utilisateur peut l'exécuter pendant plusieurs jours. Dans ce cas, je pourrais finir avec 100k lignes de texte que vous pourriez faire défiler.Scrollview - Limites de TextView en termes de nombres de lignes
Cela ne semble pas raisonnable. Je devrais voir quelques limites de mémoire. Combien de lignes de texte maintiendriez-vous à max?
Pouvez-vous avoir une vue de texte qui maintiendrait les dernières lignes de 1k de texte? Dois-je le faire avec seulement un textviewavec une maxlines de 1k et scrollbar?
Au moment où j'ai le code XML suivant:
<?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>