目录
Kv设计语言¶
Kivy 提供了一种专门针对简单且可扩展的 GUI 设计的设计语言。该语言使得将界面设计与应用逻辑分离变得简单,遵循了`关注点分离原则 <https://en.wikipedia.org/wiki/Separation_of_concerns>`_。例如:
在上述代码中:
<LoginScreen>: # every class in your app can be represented by a rule like
# this in the kv file
GridLayout: # this is how you add your widget/layout to the parent
# (note the indentation).
rows: 2 # this how you set each property of your widget/layout
就这样,用Kv语言设计你的GUI就是这么简单。如需更深入的理解,请参阅:doc:`/guide/lang`文档。