Хотел бы попросить вашу помощь.Boxlayouts in Scrollview
Прокручиваемая структура под link - это то, что я хочу сгенерировать.
Поскольку Scrollview принимает только один элемент, я использовал GridLayout. Почему-то я не могу поставить Boxlayout в GridLayout.
Не могли бы вы мне помочь? Я сделал ошибку? Должен ли я использовать, возможно, другой макет? если да, то какой?
Спасибо.
Вот результат моего файла .kv: http://imgur.com/etilRPg
Вот результат, если я изменю COLS: 1 до смещ_по_столбцев: 2: http://imgur.com/ihWla4Y
Вот код, который я попробовал в .kv файл:
#:kivy 1.8.0
RootWidget:
# import container
container: container
# fill container
BoxLayout:
id: container
orientation: 'vertical'
padding: 0
spacing: 3
ScrollView:
size_hint: 1, 1
pos_hint: {'center_x': .5, 'center_y': .5}
GridLayout:
cols: 1
padding: 0
spacing: 3
size_hint: 1, None
height: self.minimum_height
do_scroll_x: False
BoxLayout:
height: 260
orientation: 'horizontal'
canvas.before:
Color:
rgb: 0.7, 0.7, 0.9
Rectangle:
size: self.size
pos: self.pos
BoxLayout:
height: 260
orientation: 'horizontal'
canvas.before:
Color:
rgb: 0.7, 0.7, 0.9
Rectangle:
size: self.size
pos: self.pos
BoxLayout:
height: 260
orientation: 'horizontal'
canvas.before:
Color:
rgb: 0.7, 0.7, 0.9
Rectangle:
size: self.size
pos: self.pos
#type
Label:
height: 260
size_hint: 1, None
text: 'Typ'
BoxLayout:
height: 260
orientation: 'horizontal'
canvas.before:
Color:
rgb: 0.7, 0.7, 0.9
Rectangle:
size: self.size
pos: self.pos