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. cocos2d-x3.0之请求网络(phpserver)

    HelloWorldScene.h #ifndef __HELLOWORLD_SCENE_H__ #define __HELLOWORLD_SCENE_H__ #include "cocos ...

  2. php 基础算法(用*表示金字塔)通过hash 比較两个数组同样的数

    当作为一名php 程序猿,每天总与数据库打交道,做着最底层的程序猿的工作,開始着手研究一些算法,希望自己能在计算机的道路上走的更远.事实上我更喜欢管理,希望自己能作为一个卓越的管理者,但并不影响我对技 ...

  3. ftk学习记录(IME文章)

    [声明:版权全部,欢迎转载.请勿用于商业用途. 联系信箱:feixiaoxing @163.com] 前面说的是全屏设置,还是请大家看一下效果图. watermark/2/text/aHR0cDovL ...

  4. 红米1S Mokee4.4.4 本人编译版耳机线控改动调音量以及上下曲方法

    改动的文件为,用Re管理器编辑: system/usr/keylayout/msm8226-tapan-snd-card_Button_Jack.kl 默认的耳机线控的上下键是切换上下曲功能,因此此文 ...

  5. Android 通过网络打开自己的APP(scheme)

    通过使用手机的浏览器(内部.第三方能够)访问网页,点击一个链接,开始实施自己的应用程序,和传输数据. 第一Mainifest面对文件启动Activity添加过滤器. <activity andr ...

  6. JS解析DataSet.GetXML()方法产生的xml

    在实际的项目制作过程中,经常要采用ajax方式来进行,当然,这就免不了要进行数据交换.如果采用拼接字符串的方式来进行,不仅拼接的时候麻烦,而且在拆解的时候更加麻烦,一旦遇到特殊字符,那么就是灾难了.因 ...

  7. mcstructs使用CMake生成Makefile文件

    CMakeLists.txt project(MCSTRUCTS) set(SRC_LIST src/main.c src/mcslist.c src/mcsringbuf.c) add_execut ...

  8. 基于Jcrop的图片上传裁剪加预览

    最近自己没事的时候研究了下图片上传,发现之前写的是有bug的,这里自己重新写了一个! 1.页面结构 <!DOCTYPE html> <html lang="en" ...

  9. 临时对象与NRV技术

    <More Effective C++>中讲到,在C++中真正的临时对象是看不见的,它们不出现在你的源代码中.建立一个没有命名的非堆(non-heap)对象会产生临时对象,这种未命名的对象 ...

  10. SQL Server 增删改

    --use用来设置当前使用哪个数据库use StudentDb--go批处理go --T-SQL中不区分大小写,数据库表中的数据是区分大小写的--例如:insert与INSERT不区分大小写,数据库表 ...