mohssine givara
mohssine givara

Reputation: 11

Python Kivy ScrollView Problem of size_hint

main.py file :

    class stacklayout(StackLayout):
        def __init__(self,**kwargs):
            super().__init__(**kwargs)
            size= dp(100)
            for i in range(0,100):
                b = Button(text=str(i+1), size_hint=(None,None),size=(size,size))
                self.add_widget(b)

bot.kv file :


    Scroll:
    
    <Scroll@ScrollView>:
        stacklayout:
            size_hint:1,None
            height: self.minimum_height
    
    
    <stacklayout>:
        # padding: ...

Error I am getting :

size_hint:1,None
SyntaxError: invalid syntax

I had tried enough to solve but no success.

Upvotes: 0

Views: 168

Answers (1)

John Anderson
John Anderson

Reputation: 39012

Change your class name from stacklayout to Stacklayout. Any class names in kv should start with upper case and not following that rule can cause syntax errors.

Upvotes: 0

Related Questions