0

I don't understand how to get the spacing right. I need the first object to start at the top and I need the words to not be bunched together.

ScreenManager:
    id: screen_manager
    size_hint_y: 80
    Screen:
        name: 'Home'
    
        ScrollView:
            do_scroll_x: False
            do_scroll_y: True
            
            MDBoxLayout:
                cols: 1
                orientation: 'vertical'
                height: self.minimum_height
                size_hint_y: None
                scroll_type: ['bars', 'content']
                
                
                Image:
                    height: self.texture_size[1]
                    size_hint_y: None
                    keep_ratio: True                            
                    source: 'images/main.png'
                
                MDLabel:
                    size_hint_y: None
                    text: 'The Purest CBD'
                    halign: "center"
                    font_style: "H1"
                
                MDLabel:
                    size_hint_y: None
                    text: 'ThoughtCloud produces 100% organic, lab tested CBD oils made from hemp plants grown on licensed farms in the USA.'
                    halign: "center"
                    font_style: "H2"
                MDFlatButton:
                    text: "MDFLATBUTTON"
                    
                    
                Image:
                    height: self.texture_size[1]
                    size_hint_y: None
                    keep_ratio: True
                    allow_stretch: True
                    source: 'images/main.png'
                Image:
                    height: self.texture_size[1]
                    size_hint_y: None
                    keep_ratio: True
                    allow_stretch: True
                    source: 'images/main.png'
eyllanesc
  • 235,170
  • 19
  • 170
  • 241

1 Answers1

0

You can use pos_hint to make sure your widgets are at right place. It's just like size_hint. You can give any value from 0 to 1 to position your widgets at right place

Ankit Sangwan
  • 1,138
  • 1
  • 7
  • 20
  • if theres no scroll view... the image is at the top, right where it should be... when i add scrollview... it automatically adds that huge space between the image and the top bar... i try pos_hint and its being stubborn... – Netore Mining Jan 12 '21 at 05:19