1

I'm trying to use the MDSegmentedControl but can't figure out how to adjust the overall width. It just runs off the screen when placed next to another widget.

KV = '''
MDScreen:
    
    
    
    MDCard:
        MDLabel:
            size_hint: None,1
            width: 200
            text: 'Gender'
        
        MDSegmentedControl:
            adaptive_width: True
            pos_hint: {"center_x": .5, "center_y": .5}
    
            MDSegmentedControlItem:
                text: "Male"
    
            MDSegmentedControlItem:
                text: "Female"
                
 
'''


class Example(MDApp):
    def build(self):
        self.theme_cls.theme_style = "Dark"
        self.theme_cls.primary_palette = "Orange"
        return Builder.load_string(KV)


Example().run()
cryptotheo
  • 151
  • 1
  • 7

0 Answers0