2
我在Kivy中有Scrollable Grid Layout
,我試圖在下面的滾動視圖中添加圖像。我無法看到它,並且我也試圖使圖像更改爲尺寸根據屏幕分辨率動態調整。如何在Kivy的Scrollable GridLayout中顯示圖像
Screen:
\t \t \t name:"easy_1_1"
\t \t \t canvas.before:
\t \t \t \t Color: \t
\t \t \t \t \t rgba:0.2,0.3,0.4,1
\t \t \t \t Rectangle:
\t \t \t \t \t size:self.size
\t \t \t BoxLayout:
\t \t \t \t orientation:"vertical"
\t \t \t \t padding:20
\t \t \t \t spacing:10
\t \t \t \t
\t \t
\t \t \t \t \t
\t \t \t \t ScrollView:
\t \t \t \t \t GridLayout:
\t \t \t \t \t \t size_hint: (1, None)
\t \t \t \t \t \t height: self.minimum_height
\t \t \t \t \t \t id: layout_content
\t \t \t \t \t \t cols: 1
\t \t \t \t \t \t spacing:10
\t \t \t \t \t \t padding:10
\t \t \t \t \t \t rows:3
\t \t \t \t \t \t
\t \t \t \t \t \t Label:
\t \t \t \t \t \t \t text_size:self.size
\t \t \t \t \t \t \t text:"[b]What is Programming ?[/b]"
\t \t \t \t \t \t \t size_hint_y:None
\t \t \t \t \t \t \t valign: 'top'
\t \t \t \t \t \t \t font_size:"24sp"
\t \t \t \t \t \t \t color:1,1,1,1
\t \t \t \t \t \t \t markup:True
\t \t \t \t \t \t \t height:"100sp"
\t \t \t \t \t \t \t halign:"left"
\t \t \t \t \t \t \t halign:'center' \t
\t \t \t \t \t \t
\t \t \t \t \t \t
\t \t \t \t \t \t Label:
\t \t \t \t \t \t \t text_size:self.size
\t \t \t \t \t \t \t text:"test"*100
\t \t \t \t \t \t \t size_hint_y:None
\t \t \t \t \t \t \t valign: 'top'
\t \t \t \t \t \t \t font_size:"17sp"
\t \t \t \t \t \t \t color:1,1,1,1
\t \t \t \t \t \t \t markup:True
\t \t \t \t \t \t \t height:"660sp"
\t \t \t \t \t \t \t halign:"left"
\t \t \t \t \t \t \t halign:'center' \t
\t \t \t \t \t \t \t
#PRoblem is here can not see the image
\t \t \t \t \t \t Image:
\t \t \t \t \t \t \t source:"aa.png"
\t \t \t \t \t \t \t
\t \t \t \t \t \t \t
\t \t \t \t \t \t \t
\t \t \t \t \t
\t \t \t \t \t \t
\t \t \t \t \t \t
\t \t \t \t Button:
\t \t \t \t \t text:"Back"
\t \t \t \t \t pos_hint_x:None
\t \t \t \t \t size_hint_y:None
\t \t \t \t \t height:"30dp"
\t \t \t \t \t background_normal: 'blue_with_finger.png'
\t \t \t \t \t background_down: 'bb1.png'
\t \t \t \t \t on_release:sm.current="easy_1"
在上面的代碼,我不能在滾動能佈局添加圖像提...任何幫助將不勝感激。
是的工作.... – Nisarg