1
私はPython(test.py)とkivy(test.kv)でいくつかのコードを書いています。
私のボックスに垂直スクロールバーを追加するにはどうすればいいですか?
do_scroll_y:真
do_scroll_x:偽
BoxLayout:私は
Kivy:boxlayoutに垂直スクロールバーを追加する方法
ScrollViewを使用しています
オリエンテーション: "垂直"
しかし私はth私はどこかでミスをしているかもしれない。
私はscrollViewが、その後の設計が台無し
test.pyを取得
from kivy.uix.screenmanager import Screen
from kivy.app import App
from kivy.lang import Builder
from kivy.core.window import Window
Window.clearcolor = (0.5, 0.5, 0.5, 1)
Window.size = (600, 700)
class ACgroup(Screen):
pass
class TestACgroup(App):
def build(self):
self.root = Builder.load_file('test.kv')
return self.root
if __name__ == '__main__':
TestACgroup().run()
test.kv
<[email protected]>:
text_size: self.size
#padding_x: 5
<[email protected]>:
multiline: False
<[email protected]>:
background_color: 1, 1, 1, 1
size_hint_y: None
height: self.parent.height * 0.100
ACgroup:
BoxLayout:
orientation: "vertical"
GridLayout:
cols: 2
padding : 15, 15
spacing: 20, 5
row_default_height: '20dp'
size_hint: 1, .01
pos_hint: {'x': 0, 'y':.95}
CustomLabel:
text: 'Fname'
text_size: self.size
halign: 'left'
valign: 'middle'
size_hint_x: 2
SingleLineTextInput:
id: acGroup
size_hint_x: 7
Label:
text: 'Name'
text_size: self.size
halign: 'left'
valign: 'middle'
size_hint_x: 2
SingleLineTextInput:
id: stateName
GridLayout:
cols: 4
padding : 15, 10
spacing: 20, 5
row_default_height: '20dp'
size_hint: 1, .01
pos_hint: {'x': 0, 'y':.7}
CustomLabel:
text: 'ADDRESS :-'
CustomLabel:
CustomLabel:
CustomLabel:
CustomLabel:
text: 'City'
text_size: self.size
halign: 'left'
valign: 'middle'
size_hint_x: 2
SingleLineTextInput:
id: acGroup
size_hint_x: 4.5
Label:
text: 'Pin'
text_size: self.size
valign: 'middle'
halign: 'right'
SingleLineTextInput:
id: stateCode
CustomLabel:
text: 'Area'
text_size: self.size
halign: 'left'
valign: 'middle'
size_hint_x: 2
SingleLineTextInput:
id: acGroup
size_hint_x: 4.5
GridLayout:
cols: 6
padding: 15, 15
spacing: 5, 5
row_default_height: '20dp'
size_hint: 1, .005
pos_hint: {'x': 0, 'y':.5}
CustomLabel:
text: 'Address'
text_size: self.size
halign: 'left'
valign: 'middle'
size_hint_x: 2
#size_hint_y: 2
SingleLineTextInput:
id: acGroup
size_hint_x: 3
#size_hint_y: 2
SingleLineTextInput:
id: acGroup
size_hint_x: 3
#size_hint_y: 0
GridLayout:
cols: 2
padding : 15, 5
spacing: 10, 10
row_default_height: '20dp'
size_hint: 1, .02
pos_hint: {'x': 0, 'y':.4}
CustomLabel:
text: 'CONTACT DETAIL:-'
CustomLabel:
Label:
text: 'Phone'
text_size: self.size
halign: 'left'
valign: 'middle'
size_hint_x: 2
SingleLineTextInput:
id: acGroup
size_hint_x: 6.5
#size_hint_y: 2
Label:
text: 'Mobile'
text_size: self.size
halign: 'left'
valign: 'middle'
size_hint_x: 2
SingleLineTextInput:
id: acGroup
size_hint_x: 6.5
#size_hint_y: 2
Label:
text: 'E-Mail'
text_size: self.size
halign: 'left'
valign: 'middle'
size_hint_x: 2
SingleLineTextInput:
id: acGroup
size_hint_x: 6.5
#size_hint_y: 2
GreenButton:
text: 'Ok'
GreenButton:
text: 'Cancel'
on_press: app.stop()
を使用していたとき、誰かが私を助けることができますか?