I want to set mdcard height
such that it fits mdlabel
, perhabs without me manually setting mdcard size.
please how do I do this.. Thanks in Advance..
For better understanding here's a sample code:
from kivy.lang import Builder
from kivymd.app import MDApp
from kivy.core.window import Window
Window.size = (300, 530)
KV = """
MDBoxLayout:
orientation: 'vertical'
ScrollView:
MDGridLayout:
cols: 1
adaptive_height: True
padding: '10dp', '15dp'
spacing: '15dp'
MDCard:
orientation: 'vertical'
size_hint: None, None
size: 280, 200
MDLabel:
markup: True
padding: [15, 15]
text:
'''
[size=25][b]Ford[/b][/size]
If mdlabel text becomes too many to fit into the specified mdcard size,\n
the text overslaps other things closeby..\n
So my question: How do I set MDCard height to automatically\n
adjusts accordingly to the height/size of widgets inside of it.\n
Thanks in Advance!!
'''
MDCard:
orientation: 'vertical'
size_hint: None, None
size: 280, 200
MDLabel:
markup: True
padding: [15, 15]
text:
'''
[size=25][b]Ford[/b][/size]
If mdlabel text becomes too many to fit into the specified mdcard size,\n
the text overslaps other things closeby..\n
So my question: How do I set MDCard height to automatically\n
adjusts accordingly to the height/size of widgets inside of it.\n
Thanks in Advance!!
'''
"""
class Example(MDApp):
def build(self):
return Builder.load_string(KV)
Example().run()
just like the code above, If mdlabel text becomes too many to fit into the specified mdcard size, the text overslaps other things closeby.. So my question: How do I set MDCard height to automatically adjusts accordingly to the height/size of widgets inside of it. Thanks in Advance!!