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.
随机推荐
- Spark入门级小玩
·背景 随着周边吐槽hadoop的声音渐渐多起来之后,spark也逐渐进入了大家的视野.之前,笔者有粗略的写过一篇spark的安装和性能比较[http://www.cnblogs.com/zacard ...
- 【翻译自mos文章】SYS_OP_C2C 导致的全表扫描(fts)/全索引扫描
SYS_OP_C2C 导致的全表扫描(fts)/全索引扫描 參考原文: SYS_OP_C2C Causing Full Table/Index Scans (Doc ID 732666.1) 适用于: ...
- 2014Esri国际用户大会ArcGIS Online
1.基于什么是新的ArcGISOnline? ArcGISOnline不断更新.大约每四个月就会把新的增强的功能公布到各部分中.有新的空间分析的应用程序,如 Explorer forArcGIS,ap ...
- linux 下一个 jira-6.3.6 组态 皴 翻译 迁移数据库
每一个版本号翻译包下载 https://translations.atlassian.com/dashboard/download jira下载地址 https://www.atlassian.c ...
- sql点滴42—mysql中的数据结构
原文:sql点滴42-mysql中的数据结构 MySQL 的数值数据类型可以大致划分为两个类别,一个是整数,另一个是浮点数或小数.许多不同的子类型对这些类别中的每一个都是可用的,每个子类型支持不同大小 ...
- mysql设置root的密码
mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
- 快速构建Windows 8风格应用23-App Bar概述及使用规范
原文:快速构建Windows 8风格应用23-App Bar概述及使用规范 本篇博文主要介绍App Bar概述.App Bar命令组织步骤.App Bar最佳实践. App Bar概述 Windo ...
- Android在WebView上构建Web应用程序
原文链接:http://developer.android.com/guide/webapps/webview.html reference:http://developer.android.com/ ...
- 1001. 杀死吸引力(3n+1)猜想 (15)(ZJUPAT 数学)
主题链接:http://pat.zju.edu.cn/contests/pat-b-practise/1001 卡拉兹(Callatz)猜想: 对不论什么一个自然数n,假设它是偶数,那么把它砍掉一半. ...
- Dev环境中的集成测试用例执行时上下文环境检查(实战)
Dev环境中的集成测试用例执行时上下文环境检查(实战) Microsoft.NET 解决方案,项目开发必知必会. 从这篇文章开始我将分享一系列我认为在实际工作中很有必要的一些.NET项目开发的核心技术 ...