http://kivy.org/docs/api-kivy.uix.gridlayout.html?highlight=gridlayout#kivy.uix.gridlayout

It's so nice to try this one:

from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button class LoginScreen(GridLayout): def __init__(self, **kwargs):
super(LoginScreen, self).__init__(**kwargs)
#self.cols = 3 # 3 columns
self.rows = 3 # 3 rows
self.add_widget(Label(text='User Name')) #add widget label : content User Name
self.username = TextInput(multiline=False) # no multiline text input support
self.add_widget(self.username) #add 'username' textinput
self.add_widget(Label(text='Pass Word')) #add widget label : content User Name
self.password = TextInput(multiline=False, password=True) #password auto-hidden
self.add_widget(self.password)
self.btn1 = Button(text='Login', fontsize=14)
self.add_widget(self.btn1) class MyApp(App):
def build(self):
return LoginScreen() if __name__ == "__main__":
MyApp().run()

I added a button down there.

And let's see what gonna happen later.

Change the self.rows , it inherits from the class "GridLayout"

Let's see it would look like this:

now we see the login button down there :D

But we need event to be triggered when the "Login" button's pressed.

So

kivy Grid Layout的更多相关文章

  1. CSS3 GRID LAYOUT

    CSS3 GRID LAYOUT http://www.w3cplus.com/blog/tags/356.html 中国首个开源 HTML5 跨屏前端框架 http://amazeui.org/

  2. iphone Dev 开发实例9:Create Grid Layout Using UICollectionView in iOS 6

    In this tutorial, we will build a simple app to display a collection of recipe photos in grid layout ...

  3. Unity3D 使用 UI 的 Grid Layout Group 组件。

    1.首先创建一个容器,用于存放列表项的内容. 这里使用 Panel 来做为容器. 这里要注意! “Grid Layout Group”是要增加在容器的游戏对象里. 同时,只有容器对象的子对象才有排列效 ...

  4. WPF笔记(2.4 Grid)——Layout

    原文:WPF笔记(2.4 Grid)--Layout 第一章已经简单介绍过这个容器,这一节详细介绍.Grid一般是用表格(Grid.Row 和Grid.Column )的,比StackPanel更细致 ...

  5. flexbox与grid layout的区别

    flexbox是一种针对一维的局部布局,以轴为核心的弹性布局. grid layout是二维的更加全面的网格布局,

  6. CSS: Grid Layout Module

    Grid Layout The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, mak ...

  7. [Grid Layout] Use the repeat function to efficiently write grid-template values

    We can use the repeat() function if we have repeating specifications for columns and rows. With the  ...

  8. [Grid Layout] Describe a grid layout using named grid lines

    We can use named grid lines to describe our grid layout. Let’s see how to apply this to our grid-tem ...

  9. [Grid Layout] Specify a grid gutter size with grid-gap

    It’s beautifully straightforward to add a gutter to our grid layout. Let’s apply one with grid-gap.

随机推荐

  1. C#操作 Advantage Database Server 数据库

    相关下载 http://devzone.advantagedatabase.com/dz/content.aspx?key=31 1.安装数据库: Advantage Database Server ...

  2. GetDirectories 出错的解决方法

    我想找到D盘里面所有 "*.pst文件,类似 windows 下的磁盘搜索功能, using System.IO; Directory.GetFiles(@"d:\", ...

  3. SVN记录使用过程中出现的错误(一)

    由于使用SVN时间不长,故障各种奇怪的问题是不可避免的,这里记录,自己的方便还是菜鸟跟我一样的参考 一个问题: dzt@dzt-All-Series:~/D/dzt/workarea/7301_mp/ ...

  4. 经验总结35--IP地址区域匹配

    想知道客服端訪问的IP地址是多少,并知道区域. 一般能够去http://www.ip138.com/,输入IP查询,但没提供比較好的接口,程序使用不方便. 另外有些企业提供一些离线的IP数据库,能够进 ...

  5. 新服务器部署sqlserver之前的准备

    当你有一个新的服务器需要部署的时候,如果没有部署过的经验很可能会走很多误区,并且给以后的维护工作加大难度,我在这就把我部署服务器的一些经验跟大家分享一下. 1.登陆服务器以后先将物理盘按照64k为分配 ...

  6. u-boot学习(两):u-boot简要分析

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 看到不错的文章.不要加入收藏夹, ...

  7. PHP 10 : 流程控制

    原文:PHP 10 : 流程控制 感觉PHP和其他语言相似.说说PHP提供的流程控制关键字吧. 条件 ifelseelseifswitch 循环 whiledo{} while()breakconti ...

  8. 你不知道的 页面编码,浏览器选择编码,get,post各种乱码由来

    原文:你不知道的 页面编码,浏览器选择编码,get,post各种乱码由来 asp.net页面编码和浏览器的选择编码 每个asp.net的朋友都知道,在新版本的visual studio,在没有任何设置 ...

  9. 编解码器的学习笔记(十):Ogg系列

    Ogg是一个自由和开放的标准容器格式,由Xiph.Org 维修基金. Ogg格式不受软件专利的限制,它的目的是有效地处理高品质的流媒体和数字媒体. Ogg意指一种文件格式,能够纳入各式各样自由和开放源 ...

  10. using和yield return

    C#中的using和yield return混合使用 最近写代码为了为了省事儿用了几个yield return,因为我不想New一个List<T>或者T[]对象再往里放元素,就直接返回IE ...