锚点布局,AnchorLayout,可以将子控件设置在左上,中上,右上,左中,正中,右中,左下,中下,右下等9个位置,使用时需要指定anchor_x和anchor_y两个属性。
anchor_x,默认为’center',可以接受‘left','center','right'值,分别表示,左中右。
anchor_y,默认为'center',可以接受’top','center','bottom'值,分别表示,上中下。
示例,先定义一个anchor.kv文件,代码如下
<AnchorLayoutWin>: padding:20 AnchorLayout: anchor_x:'left' anchor_y:'top' Button: text:'button1' size_hint:.3,.2 AnchorLayout: anchor_x:'right' anchor_y:'bottom' Button: text:'butto