android笔记一 控件属性
<?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笔记一 控件属性的更多相关文章
- android 自己定义控件属性(TypedArray以及attrs解释)
近期在捣鼓android 自己定义控件属性,学到了TypedArray以及attrs.在这当中看了一篇大神博客Android 深入理解Android中的自己定义属性.我就更加深入学习力一番.我就沿着这 ...
- Android笔记---常用控件以及用法
这篇文章主要记录下Android的常用控件以及使用的方法,Android 给我们提供了大量的UI控件,合理地使用这些控件就可以非常轻松地编写出相当不错的界面,这些是Android学习的基础,没有什么业 ...
- ios 学习笔记之控件属性
1.文本框 设置密码属性:Secure Text Entry 勾选; 设置文本框带清除属性: Clear Button =Is always visible; 默认是不带清除属性:Never app ...
- Android 中LinearLayout控件属性
id 为控件指定相应的ID text 指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件当中的字符 g ...
- Android自己定义控件皮肤
Android自己定义控件皮肤 对于Android的自带控件,其外观仅仅能说中规中矩,而我们平时所示Android应用中,一个简单的button都做得十分美观.甚至于很多button在按下时的外观都有 ...
- Android控件属性大全(转)
http://blog.csdn.net/pku_android/article/details/7365685 LinearLayout 线性布局 子元素任意: Tab ...
- Android控件属性大全[整理转载]
控件属性: android属性 Android功能强大,界面华丽,但是众多的布局属性就害苦了开发者,下面这篇文章结合了网上不少资料, 第一类:属性值为true或falseandroid:layout_ ...
- 【转载】Android控件属性大全
控件属性: android属性 Android功能强大,界面华丽,但是众多的布局属性就害苦了开发者,下面这篇文章结合了网上不少资料, 第一类:属性值为true或falseandroid:layout_ ...
- Android布局及控件的属性说明
android常用的一些属性说明 android:id --- 为控件指定相应的ID android:text --- 指定控件当中显示的文字,需要注意的是,这里尽量使用strings.xml文件 ...
随机推荐
- 设置Treeview背景色的问题1
有没有哪位兄弟在VB中使用sendmessage对TreeView改变背景色?我现在遇到一个问题,如果把linestyle设为1 的时候,展开节点的时候root部位会 有一个下拉的白色块,如果设为1 ...
- Codeforces Round #228 (Div. 1) C 贪心
嘎嘎,今天被一些事耽误了,可是还是A了几个题目,这道题还不错 题目链接: 题意:两个人玩游戏,有N堆纸牌,纸牌上有数字,A每次仅仅能取N堆中的 当中一个的顶部的 纸牌,B仅仅能取N堆中的当中一个底部 ...
- Oracle 删除表中记录 如何释放表及表空间大小
1.查看一个表所占的空间大小:SELECT bytes/1024/1024 ||'MB' TABLE_SIZE ,u.* FROM USER_SEGMENTS U WHERE U.SEGMENT_NA ...
- cydia源
http://apt.91.com http://apt.178.com Flex 2的官方安装源是 getdelta.co
- Eclipse 中选中一个单词 ,其他相同的单词颜色就会变化
"Window"-"preferences"-"Java"-"Editor"-"Mark Occurrence ...
- java 类名.class、object.getClass()和Class.forName()的区别 精析
1.介绍 getClass()介绍 java是面向对象语言,即万物皆对象,所有的对象都直接或间接继承自Object类: Object类中有getClass()方法,通过这个方法就可以获得一个实 ...
- 虚拟机安装的Winserver 2008 R2系统,宿主机无法ping通主机
新安装的虚拟机,在虚拟机中安装了Winserver2008 R2系统,网络适配器已经设置为桥接模式(自动) 刚开始的几天很正常,但是过了几天后,发现连接不了了,后来才发现是因为网络问题. 解决方案:修 ...
- iOS开发之复制字符串到剪贴板
概述 一般有邀请复制链接需求功能,把字符串复制到系统剪贴板,供用户粘贴使用链接. 详细 代码下载:http://www.demodashi.com/demo/10714.html 一.主要思路 1.在 ...
- Android 进程间通信——Service、Messenger
概述 介绍绑定服务端的三种方式:同一进程绑定服务.跨进程绑定服务(Messenger).跨进程绑定服务(aidl). 重点说一下通过Messenger.Service实现的进程间通信. 详细 代码下载 ...
- 【laravel5.4】使用baum\node 类库实现无限极分类
1.在model中引入baum\node 类库,并继承,具体参考 https://packagist.org/packages/baum/baum 2.核心代码: /* * model::create ...