kivy Grid Layout
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的更多相关文章
- CSS3 GRID LAYOUT
		CSS3 GRID LAYOUT http://www.w3cplus.com/blog/tags/356.html 中国首个开源 HTML5 跨屏前端框架 http://amazeui.org/ 
- 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 ... 
- Unity3D 使用 UI 的 Grid Layout Group 组件。
		1.首先创建一个容器,用于存放列表项的内容. 这里使用 Panel 来做为容器. 这里要注意! “Grid Layout Group”是要增加在容器的游戏对象里. 同时,只有容器对象的子对象才有排列效 ... 
- WPF笔记(2.4 Grid)——Layout
		原文:WPF笔记(2.4 Grid)--Layout 第一章已经简单介绍过这个容器,这一节详细介绍.Grid一般是用表格(Grid.Row 和Grid.Column )的,比StackPanel更细致 ... 
- flexbox与grid layout的区别
		flexbox是一种针对一维的局部布局,以轴为核心的弹性布局. grid layout是二维的更加全面的网格布局, 
- CSS: Grid Layout Module
		Grid Layout The CSS Grid Layout Module offers a grid-based layout system, with rows and columns, mak ... 
- [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 ... 
- [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 ... 
- [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. 
随机推荐
- The Swift Programming Language-官方教程精译Swift(5)集合类型 -- Collection Types
			Swift语言提供经典的数组和字典两种集合类型来存储集合数据.数组用来按顺序存储相同类型的数据.字典虽然无序存储相同类型数据值但是需要由独有的标识符引用和寻址(就是键值对). Swift语言里的数 ... 
- Node+Express+MongoDB + Socket.io搭建实时聊天应用
			Node+Express+MongoDB + Socket.io搭建实时聊天应用 前言 本来开始写博客的时候只是想写一下关于MongoDB的使用总结的,后来觉得还不如干脆写一个node项目实战教程实战 ... 
- 出现Deprecated: Function ereg_replace() is deprecated in 的原因及解决方法
			在 php5.3环境下运行oscommerce,常常会出现Deprecated: Function ereg() is deprecated in...和Deprecated: Function er ... 
- [译]Java 设计模式之中介者
			(文章翻译自Java Design Pattern: Mediator) 中介者设计模式被用于一组的同事进行协作.这些同事不彼此进行直接的交流联系,但是是通过中介者. 在下面的例子中,A同事想去说话, ... 
- Ubuntu加上一个命令搜索路径/etc/ environment
			编辑~/.bashrc文件,然后在最后加上你想设置的目录就可以了. 这样做之后就可以在终端中执行你想要的程序了,不过如果你使用其它程序在后台调用的话可能还是会调用不到,因为这个设置是针对bash有效的 ... 
- 读书笔记—CLR via C#章节1-2
			这本书这几年零零散散读过两三遍了,作为经典书籍,应该重复读反复读,既然我现在开始写博了,我也准备把以前觉得经典的好书重读细读一遍,并且将笔记整理到博客中,好记性不如烂笔头,同时也在写的过程中也可以加深 ... 
- Linux环境下搭建php开发环境的操作步骤
			本文主要记载了通过编译方式进行软件/开发环境的安装过程,其他安装方式忽略! 文章背景: 因为php和Apache等采用编译安装方式进行安装,然而编译安装方式,需要c,c++编译环境, 通过apt方式安 ... 
- jQuery 1.9 移除了 $.browser 的替代方法
			jQuery 从 1.9 版开始,移除了 $.browser 和 $.browser.version , 取而代之的是 $.support . 在更新的 2.0 版本中,将不再支持 IE 6/7/8. ... 
- setTimeout与setInterval的区别
			setTimeout与setInterval的区别:1.setTimeout设置后隔指定时间后只会执行一次2.setInterval设置后会每隔指定时间执行一次3.setTimeout一般在方法内部使 ... 
- SHELL 近期学习
			由于项目中很少使用到shell脚本所以.只是偶尔自学一点.慢慢积累.下面就把近段时间积累的发出来.学习. #sort sort 按首字母排序 sort -n 按数字大小 从小到大排序 sort -rn ... 
