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. 表现层及ASP.NET MVC介绍(二)

    表现层及ASP.NET MVC介绍(二) 最近的更新速度越来越慢,主要是项目上比较忙,封装EasyUi也要花很多时间.不过大家请放心,本系列不会半途夭折,并且代码干货也会持续更新.本文继续介绍表现层和 ...

  2. Ubuntu更改hosts档

    Ubuntu更改hosts档 打开hosts档 sudo gedit /etc/hosts 下载hosts,并全选复制 hosts 粘贴到hosts文件里.保存就可以 $(function () { ...

  3. Archlinux YouCompleteMe+syntastic vim自己主动补全插件,显示缩进和状态栏美化,爽心悦目的vim

    Archlinux 安装和配置vim补全插件YouCompleteMe的过程. 參考: https://github.com/Valloric/YouCompleteMe https://github ...

  4. AngularJS应用开发思维之3:依赖注入

    找不到的API? AngularJS提供了一些功能的封装,但是当你试图通过全局对象angular去 访问这些功能时,却发现与以往遇到的库大不相同. $http 比如,在jQuery中,我们知道它的AP ...

  5. android 如何加入第一3正方形lib图书馆kernel于

    注意:只能lib图书馆kernel编译到位.例如下列: alps/kernel/ alps/mediatek/custom/common/kernel/ alps/mediatek/custom/$p ...

  6. <<Python基础课程>>学习笔记 | 文章13章 | 数据库支持

    备注:本章介绍了比较简单,只是比较使用样品,主要假设是把握连接,利用数据库.和SQLite做演示样本 ------ Python数据库API 为了解决Python中各种数据库模块间的兼容问题,如今已经 ...

  7. 实现一个简单的Unity3D三皮卡——3D Picking (1)

    3D Picking 其原理是从摄像机位置到空间发射的射线.基于光线碰到物体回暖. 这里我们使用了触摸屏拿起触摸,鼠标选择相同的原理,仅仅是可选API不同. 从unity3D官网Manual里找到下面 ...

  8. Monkey源码分析之事件源

    上一篇文章<Monkey源码分析之运行流程>给出了monkey运行的整个流程,让我们有一个概貌,那么往后的文章我们会尝试进一步的阐述相关的一些知识点. 这里先把整个monkey类的结构图给 ...

  9. navigator,JS检测浏览器插件

    最早由Netscape Navigator 2.0引入的navigator对象,现在已经成为识别客户端浏览器的事实标准.虽然其它浏览器也通过其它方式提供了相同或相似的信息(例如,IE中的window. ...

  10. Android项目--tabhost

    所有牵扯到自定义布局的layout中尽量用RelativeLayout 在通讯录中如果像小米手机的UI那就是viewpager,在这里,我们做成静态的.通过tabhost来做. 1.布局 a) 直接用 ...