<?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. 转:C#委托与事件

    委托与事件    Ganesh Nataraj最近写了一篇解释委托与事件的文章,在坊间流传较广,今天翻译成中文与大家共享,如有不妥之处,欢迎留言讨论.    C#中的委托类似于C或C++中的函数指针. ...

  2. VarPtr 得到地址 指针

    在Basic语言演变成QBasic,然后到Visual Basic之前,VarPtr函数就已经存在了.开始,这个函数存在于VB运行库1.0版中.通过声明可以调用这个函数: Declare Functi ...

  3. JavaSE入门学习17:Java面向对象之package(包)

           一Java包(package)        为了更好地组织类,Java提供了包机制,用于差别类名的命名空间.        包的作用:        A把功能类似或相关的类或接口组织在 ...

  4. 如何解决Cydia提示错误

    删除/etc/apt/sources.list.d该目录下的cydia.list进入var/lib/apt/lists删掉此文件夹下的所有文件,以及partial下的文件,但须保留这个空文件夹.进入/ ...

  5. C10K——千万级并发实现的秘密:内核不是解决方案,而是问题所在!(转)

    既然我们已经解决了 C10K并发连接问题,应该如何提高水平支持千万级并发连接?你可能会说不可能.不,现在系统已经在用你可能不熟悉甚至激进的方式支持千万级别的并发连接. 要知道它是如何做到的,我们首先要 ...

  6. java两种同步机制的实现 synchronized和reentrantlock

    java两种同步机制的实现 synchronized和reentrantlock 双11加保障过去一周,趁现在有空,写一点硬货,因为在进入阿里之后工作域的原因之前很多java知识点很少用,所以记录一下 ...

  7. eclipse tomcat路径更改后启动报错

      eclipse tomcat路径更改后启动报错 CreateTime--2018年5月3日14:48:22 Author:Marydon 1.情景还原 2.原因 本地的tomcat路径修改后,ec ...

  8. 【shell】正则表达式

    当一个文件或命令输出中抽取或过滤文本时,可以使用正则表达式(RE),正则表达式是一些特殊或很不特殊的字符串模式的集合. 在Linux中grep.awk.sed均可解释正则 1.基本元字符集及其定义 ^ ...

  9. elasticsearch5.4体验

        Elasticsearch是基于Lucene分布式.实时查询的搜索分析引擎.我目前应用在日志集中化处理上... 01.下载elasticsearch5.4 https://www.elasti ...

  10. SecureCRT 详细使用教程和技巧

    SecureCRT 常用技巧 0.在secureCRT里切换不同的窗口:ctrl+tab.    复制:[ctrl] + [shift] + c    粘贴:[ctrl] + [shift] + v  ...