当TextInput足够小时,我们谈论的是24dp或更小,文本会被自动裁剪以适应与边框的一定距离,就像这样。

我不想增加它的大小,如果我进一步减小字体大小,它将是不可读的。我一直在修改TextInput的颜色和边框,但它不会修改这个不可见的边框。我已经在StackOverflow上搜索了一段时间,但没有找到答案。
class HomeScreen(Screen):
def __init__(self, **kwargs):
super(HomeScreen, self).__init__(**kwargs)
self.layout = FloatLayout()
self.layout.add_widget(TextInput(pos_hint={'x':.5,'y':.5},
size_hint=(None,None),
size=(100,20)))
class MyApp(App):
drops = []
def build(self):
Config.set('input', 'mouse', 'mouse,disable_multitouch')
Config.set('kivy', 'exit_on_escape', 0)
Config.write()
sm = ScreenManager()
sm.add_widget(HomeScreen())
return sm
if __name__ == '__main__':
MyApp().run()发布于 2019-07-12 18:04:26
根据documentation的默认填充为6、6、6、6
尝试添加padding =3作为TextInput参数
https://stackoverflow.com/questions/57003821
复制相似问题