0

私はあなたの助けを求めたいです。

リンクの下のスクロール可能な構造は、私が生成したいものです。

Scrollview は 1 つの要素しか受け付けないため、GridLayout を使用しました。どういうわけか、GridLayout に Boxlayout を配置できません。

私たちを手伝ってくれますか?私は間違いを犯しましたか?おそらく他のレイアウトを使用する必要がありますか?はいの場合、どれですか?

ありがとうございました。

これが私の .kv ファイルの出力です: http://imgur.com/etilRPg

cols:1 を cols: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
4

1 に答える 1