本文介紹了如何在 Kivy ScrollView 中滾動 GridLayout?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
目前這是我無法滾動的 kv 代碼:
At the moment this is my kv code that is not scrollable:
如何讓上面的 kv 代碼可滾動?我知道 Kivy ScrollView 只接受一個孩子,而且我已經讓 GridLayout 成為新 ScrollView 的孩子.但它不起作用.有什么建議嗎?
How do you make the above kv code scrollable? I know that Kivy ScrollView only accept one child, and I have already make GridLayout to be child of a new ScrollView. But it's not working. Any suggestion?
推薦答案
根據ScrollView 的文檔 您必須至少禁用 ScrollView 的子 size_hint 之一:
According to the documentation for ScrollView you have to disable at least one of the ScrollView's child size_hint:
并綁定布局的大小以適應自身:
And bind the layout's size to adapt itself:
這篇關于如何在 Kivy ScrollView 中滾動 GridLayout?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!