我们知道,在 RelativeLayout 布局中有很多特殊的属性,通常在载入布局之前,在相关的xml文件中进行静态设置即可。但是,在有些情况下,我们需要动态设置布局的属性,在不同的条件下设置不同的布局排列方式,这时候就需要用到RelativeLayout.LayoutParams.addRule(...
分类:
移动开发 时间:
2015-01-26 21:04:05
阅读次数:
681
隐式Intent不明确指出我们想要启动哪个活动,而是指定了一系列的action、data或category等信息,然后交由系统去分析这个Intent,并帮我们找出合适的活动去启动
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.an...
分类:
其他好文 时间:
2015-01-23 23:03:32
阅读次数:
216
LinearLayout和RelativeLayout转自:http://blog.csdn.net/w176236767/article/details/6605848共有属性:java代码中通过btn1关联次控件android:id="@+id/btn1"控件宽度android:layout_w...
分类:
其他好文 时间:
2015-01-23 15:58:46
阅读次数:
148
Android官方入门文档[3]构建一个简单的用户界面
这节课教你
1.创建一个线性布局
2.添加一个文本字段
3.添加字符串资源
4.添加一个按钮
5.输入框中填写屏幕宽度...
分类:
移动开发 时间:
2015-01-23 11:12:15
阅读次数:
285
接触安卓有两个月的时间了,一直觉得LinearLayout有什么好学的,觉得想做比较复杂的应用UI都得是使用RelativeLayout才好,最近做项目看了别人的代码后才发现,线性布局在做复杂项目的时候,一样是非常重要!1、layout_width:这个变量可以用来按比例摆放几个控件2、layout...
分类:
移动开发 时间:
2015-01-22 23:17:22
阅读次数:
278
http://blog.csdn.net/heqiangflytosky/article/details/31777363一文详细介绍了Android ContentProvider、ContentResolver和ContentObserver的用法,现在来做一个ContentProvider完整Demo。
直接上代码:
fragment_main.xml
<RelativeLayout ...
分类:
其他好文 时间:
2015-01-22 18:01:41
阅读次数:
188
这是一个listpopwindow的布局,如果listview在relativeLayout之后写的那么listview就会把relativeLayout给覆盖掉,这证明布局的加载是按照布局文件写的先后顺序来加载的,也就是说先绘制listView,然后在绘制relativeLayout.解决办法: ...
分类:
其他好文 时间:
2015-01-20 20:19:10
阅读次数:
144
(1)布局文件如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_hei...
分类:
移动开发 时间:
2015-01-20 15:47:59
阅读次数:
193
(1)第一种使用xml文件进行注册
布局文件,添加一个button点击的时候进行广播
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="mat...
分类:
移动开发 时间:
2015-01-20 15:43:35
阅读次数:
154
android:autoLink 设置是否当文本为URL链接/email/电话号码/map时,文本显示为可点击的链接。可选值(none/web/email/phone/map/all)
android:autoText 如果设置,将自动执行输入值的拼写纠正。此处无效果,在显示输入法并输入的时候起作用。
android:bufferType 指定getTex...
分类:
移动开发 时间:
2015-01-19 21:10:17
阅读次数:
190