Bonjour à tous,
J'utilise une ScrollView dans mon application pour permettre d'afficher tout les composants que contient mon fichier XML.
Parmi ces composants j'ai une TextView contenant un texte de taille variable. Si le texte est court (quelques lignes seulement) tout ce passe bien car les composants rentrent sur la page. Cependant si le texte prends plus d'une dizaine de lignes je rencontre un problème avec le défilement de la page. En effet la page défile mais pas correctement. L'ascenseur ne permet pas de remonter jusqu'en haut de la page et les composants situés le plus en haut de ma page sont donc inaccessible/invisible pour l'utilisateur.
Je vous mets à disposition le code de mon fichier xml :
En espérant que vous pourrez m'aider,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70 <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center" > <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="vertical" > <TextView android:id="@+id/..." android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:padding="10dp" /> <ImageView android:id="@+id/..." android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" /> <TextView android:id="@+id/..." android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" android:padding="10dp" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="horizontal" > <ImageButton android:id="@+id/..." android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" /> <ImageButton android:id="@+id/..." android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" /> <ImageButton android:id="@+id/..." android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="10dp" /> </LinearLayout> </LinearLayout> </ScrollView>
Nylwen
Partager