python - 如何增加 BoxLayout --kivy 内的 mdtextfield 的大小
问题描述
我想创建一个具有特定size_hint的文本字段,一旦字段内的文本达到特定的值minimum height
,文本字段size_hint将设置为None并将激活..使用时看起来很完美。但是当我使用 Boxlayout 时,它的大小似乎没有改变。如果我将它的 size_hint 更改为假设,则文本字段将变为一条线,如果将其保持为 None 并通过属性更改其高度,则大小不会增加..我该如何解决这个问题..除了更改布局之外的任何解决方案,因为只有 BoxLayout 是我想要/使用的东西y_scroll
FloatLayout
MDTextField
0.7
Having mode set to rectangle
height
我的代码::
str = '''
MDCard:
pos_hint : {'x':0.056 , 'top':0.836}
size_hint : 0.88,0.82
ScrollView:
do_scroll_x : False
BoxLayout:
height : self.minimum_height
orientation : 'vertical'
size_hint : 1,None
spacing : 15
padding : 55
MDTextField:
id : input_field_1
mode : 'rectangle'
size_hint : None,None
height : 500 # setting height doesn't seems to work either
#y_scroll : True if self.minimum_height > 400 else False
multiline : True
MDTextField:
id : input_field_2
mode : 'rectangle'
size_hint : None,0.7 # see the result
#y_scroll : True
multiline : True
'''
class My_4app(MDApp):
def build(self):
return Builder.load_string(str)
My_4app().run()
非常感谢任何帮助
解决方案
推荐阅读
- r - 有没有办法将与 ID 关联的日期添加到我的 Plotly 图表中?
- jquery - Jquery单选按钮追加问题
- html - 如何为这段代码提供过渡效果?
- haskell - 如何为 Applicative 实例制作适当的“纯”?
- r - group_by 但只对其中一个组进行管道操作?
- python - 如何将数据帧作为新表提交到 kdb?
- python - Python - Pandas - 我想连接到 Oracle 数据库,将数据放在数据帧上,然后将数据帧发送到 SQL Server
- c++ - C++ 合并排序可视化工具
- node.js - 通过 mongoose 中的 id 将数据获取到模式中
- mongodb - mongo shell - 显示发送到服务器的原始命令?