Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7563342
  • 博文数量: 961
  • 博客积分: 15795
  • 博客等级: 上将
  • 技术积分: 16612
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-07 14:23
文章分类

全部博文(961)

文章存档

2016年(1)

2015年(61)

2014年(41)

2013年(51)

2012年(235)

2011年(391)

2010年(181)

分类: Android平台

2015-11-17 14:24:52

    按钮在人机交互截面上使用的是最多的,当提示用户进行某些选择的时候,就可以通过按钮的操作来接收用户的选择。在Android使用“

点击(此处)折叠或打开

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout                     ?    定义线型布局管理器
  3.     xmlns:android=""
  4.     android:orientation="vertical"             ?    所有组件垂直摆放
  5.     android:layout_width="fill_parent"            ?    布局管理器宽度为屏幕宽度
  6.     android:layout_height="fill_parent">        ?    布局管理器高度为屏幕高度
  7.     <Button                     ?    定义按钮组件
  8.         android:id="@+id/mybut3"             ?    定义此按钮组件的ID,为Activity程序使用
  9.         android:layout_width="fill_parent"        ?    宽度为整个容器的宽度
  10.         android:layout_height="wrap_content"         ?    高度为文字高度
  11.         android:text="李兴华老师"            ?    设置默认的显示文本
  12.         android:layout_marginTop="10px"        ?    设置距离上边控件距离为10像素
  13.         android:maxLength="3"/>            ?    只显示3个长度文字
  14. </LinearLayout>

”组件可以定义出一个显示的按钮

020403_按钮组件:Button.ppt
阅读(993) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~