kivy_liste_des_elements_graphiques
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
kivy_liste_des_elements_graphiques [2020/01/02 10:05] – [Kivy: Liste des éléments graphiques] serge | kivy_liste_des_elements_graphiques [2020/01/07 15:18] – [ScrollView] serge | ||
---|---|---|---|
Ligne 422: | Ligne 422: | ||
</ | </ | ||
+ | ====ScrollView==== | ||
+ | **Défilement d'une liste de ligne** | ||
+ | |||
+ | <code python extrait_de_main.py> | ||
+ | class MainScreen(Screen): | ||
+ | text = StringProperty(" | ||
+ | def __init__(self, | ||
+ | super().__init__(**kwargs) | ||
+ | self.text = "Mon texte\n" | ||
+ | </ | ||
+ | |||
+ | <code python scroll.kv> | ||
+ | < | ||
+ | BoxLayout: | ||
+ | orientation: | ||
+ | ScrollView: | ||
+ | do_scroll_x: | ||
+ | do_scroll_y: | ||
+ | Label: | ||
+ | id: scroll | ||
+ | size_hint: None, None # très important ! | ||
+ | size: self.texture_size | ||
+ | height: self.size[1] | ||
+ | width: self.size[0] | ||
+ | padding: 10, 10 | ||
+ | text: root.text | ||
+ | color: 1, 0, 0.5, 1 | ||
+ | font_size: " | ||
+ | </ | ||
{{tag> | {{tag> |
kivy_liste_des_elements_graphiques.txt · Dernière modification : 2020/10/19 07:12 de serge