Error on ScrollView+StackLayout when binding minimum_height on Kivy
Question: I'm new to Kivy and I am trying to create a scroll view based the official
ScrollView [example](http://kivy.org/docs/api-kivy.uix.scrollview.html) on
Kivy docs.

I'm using the Kivy portable package for Windows with Python version 3.3.3.

When i try to run the code below with the layout.bind line uncommented i got
repeated lines of the following error:

> Warning, too much iteration done before the next frame. Check your code, or
> increase the Clock.max_iteration attribute

When i comment the layout.bind line I get a normal startup with the buttons i
added where i would expect them, but the scroll doesn't work.

    
    
    from kivy.app import App
    from kivy.uix.scrollview import ScrollView
    from kivy.uix.stacklayout import StackLayout
    from kivy.uix.button import Button
    
    class Example(App):
    
        def build(self):
            layout = StackLayout(size_hint_y=None)
    
            # If i uncomment this line, i got the error:
            # layout.bind(minimum_height=layout.setter('height'))
            for i in range(30):
                btn = Button(text=str(i), size_hint=(.33,.8))
                layout.add_widget(btn)
    
            root = ScrollView(size_hint=(None,None), size=(400, 400))
            root.add_widget(layout)
            return root
    
    if __name__ == '__main__':
        Example().run()
    

The question is why the scroll doesn't work? and why the layout.bind is
causing an error.

How should i do to have the same visual and the scroll working on x axis
without the error?

I made this piece of code as close as possible to the Kivy official
[example](http://kivy.org/docs/api-kivy.uix.scrollview.html).


Answer: This is happening because you're creating an infinite loop. The size of each
`Button` is set based on the size of the `StackLayout`. This causes the
`StackLayout` to increase in size, causing the `Button` sizes to be
recalculated, causing the `StackLayout` to increase in size, ad infinitum.

You're telling Kivy that you want the `Button` size based on the `StackLayout`
size, while also wanting the `StackLayout` size based on the combined
`Button`s size.

To fix this, you need to specify a real size instead of using `size_hint`:

    
    
    btn = Button(text=str(i), size_hint=(None, None), size=(100, 100))
    

