<?xml version = "1.0" encoding = "utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_height="fill_parent"
android:layout_width="fill_parent"
> <Button
android:id="@+id/button_test"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:layout_marginLeft="40dp"
android:layout_marginRight="60dp"
android:layout_marginBottom="100dp"
android:text="我是第1个控件"
android:textSize="12sp" /> <Button
android:id="@+id/button_test1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="15sp"
android:layout_below="@+id/button_test"
android:paddingLeft="20sp"
android:layout_gravity="right"
android:text="我是第2个控件"
android:textSize="12sp" /> <ListView
android:id="@+id/list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/button_test1" /> </LinearLayout>
<Button
android:id="@+id/button_test"
android:layout_width="wrap_content"//大小刚刚可以包住文本
android:layout_height="wrap_content"
android:layout_marginTop="30dp"//相对上方控件的距离
android:layout_marginLeft="40dp"//相对左边控件的距离
android:layout_marginRight="60dp"//相对右边控件的距离
android:layout_marginBottom="100dp"//相对下方控件的距离
android:text="我是第1个控件"
android:textSize="12sp" />//设置文本的大小 <Button
android:id="@+id/button_test1"
android:layout_width="match_parent"//宽度跟父窗口是一样的
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:paddingTop="15sp"
android:layout_below="@+id/button_test"//使该控件一直在第一个控件的下方
android:paddingLeft="20sp"//文本相对控件左边的距离
android:gravity="right"//表示文本的对齐方式
android:text="我是第2个控件"
android:textSize="12sp" />

android笔记一 控件属性的更多相关文章

  1. android 自己定义控件属性(TypedArray以及attrs解释)

    近期在捣鼓android 自己定义控件属性,学到了TypedArray以及attrs.在这当中看了一篇大神博客Android 深入理解Android中的自己定义属性.我就更加深入学习力一番.我就沿着这 ...

  2. Android笔记---常用控件以及用法

    这篇文章主要记录下Android的常用控件以及使用的方法,Android 给我们提供了大量的UI控件,合理地使用这些控件就可以非常轻松地编写出相当不错的界面,这些是Android学习的基础,没有什么业 ...

  3. ios 学习笔记之控件属性

    1.文本框 设置密码属性:Secure Text Entry 勾选; 设置文本框带清除属性: Clear Button =Is always visible;  默认是不带清除属性:Never app ...

  4. Android 中LinearLayout控件属性

    id             为控件指定相应的ID        text           指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件当中的字符        g ...

  5. Android自己定义控件皮肤

    Android自己定义控件皮肤 对于Android的自带控件,其外观仅仅能说中规中矩,而我们平时所示Android应用中,一个简单的button都做得十分美观.甚至于很多button在按下时的外观都有 ...

  6. Android控件属性大全(转)

    http://blog.csdn.net/pku_android/article/details/7365685 LinearLayout         线性布局        子元素任意: Tab ...

  7. Android控件属性大全[整理转载]

    控件属性: android属性 Android功能强大,界面华丽,但是众多的布局属性就害苦了开发者,下面这篇文章结合了网上不少资料, 第一类:属性值为true或falseandroid:layout_ ...

  8. 【转载】Android控件属性大全

    控件属性: android属性 Android功能强大,界面华丽,但是众多的布局属性就害苦了开发者,下面这篇文章结合了网上不少资料, 第一类:属性值为true或falseandroid:layout_ ...

  9. Android布局及控件的属性说明

    android常用的一些属性说明   android:id --- 为控件指定相应的ID android:text --- 指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件 ...

随机推荐

  1. __inline定义的内联函数和宏的区别

    转自:http://blog.csdn.net/lw370481/article/details/7311668 函数与宏 #define TABLE_COMP(x) ((x)>0?(x):0) ...

  2. SVN mime-type 笔记

    背景: 1.最近使用执行svn diff的时候发现有些文本文件无法显示: 2.浏览器会通过判断获取文件的 MIME 类型, 调用不同的客户端程序或使用不同的方式来执行.如果文件的 MIME 缺失或者有 ...

  3. java面试第四天

    修饰符static: 把对象相关的变成类相关的,它可以修饰属性.方法.代码块和内部类 static修饰属性(类变量): 那么这个属性就可以用" 类名.属性名 "来访问,也就是使这个 ...

  4. ORA-14300: 分区关键字映射到超出允许的最大分区数的分区

    环境为:Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production 对象表为按天的自动分区表: PARTI ...

  5. FPGA视频拼接器的DP 的4k 功能输入, 把lvds 转为 serdes

    4k(3840 x 2160 @60hz)越来越成为一种视频趋势,怎样把4K 接入到拼接器中.是一个棘手的问题. 先看一下原理图的接口: 这是 anx1122的 lvds的接口. 以下看一下系统的框架 ...

  6. KnockoutJS + My97DatePicker

    如何将Knockoutjs和其他脚本库结合使用?这里给出一个Knockoutjs与my97datepicker配合使用的例子,例子中使用了ko的自定义绑定功能: ko.bindingHandlers. ...

  7. Loadrunner脚本编程(1)-大体思路

    http://www.360doc.com/content/10/0806/13/1698198_44076570.shtml 就目前的了解.Loadrunner的脚本语言其实和C没什么区别.他内部的 ...

  8. 基于 Vue BootStrap的迷你Chrome插件

    代码地址如下:http://www.demodashi.com/demo/14306.html 安装 安装 Visual Studio Code 和Chrome, 自行FQ 详细安装这里略过 安装包管 ...

  9. 戴尔大力宣传Ubuntu 对比与Windows的差异

    2010-06-18 10:58:36   11175 人阅读   作者:萧萧 编辑:萧萧[爆料]  评论(46)   戴尔近日上线了一个新的网页,对比Linux开源系统(主要是Ubuntu)与Win ...

  10. eclipse的tasks使用说明

    http://blog.csdn.net/limb99/article/details/8881891tasks可以在代码里增加标识,通过tasks view可以快速的找到这些标识的地方,有助于提高开 ...