相对布局 RelativeLayout 允许子元素指定它们相对于其父元素或兄弟元素的位置,这是实际布局中最常用的布局方式之一。它灵活性大很多,当然属性也多,操作难度也大,属性之间产生冲突的的可能性也大,使用相对布局时要多做些测试。下面是常用的一些属性RelativeLayout用到的一些重要的属性:...
分类:
其他好文 时间:
2014-12-25 16:10:16
阅读次数:
231
Android开发中,Android屏幕适配是一件很棘手的事,需要注意的几点:尽量使用线性布局(LinearLayout)和相对布局(RelativeLayout),不要使用绝对布局;尽量使用dip和sp,不要使用px;为不同的分辨率提供不同的布局文件和图片;在AndroidMainfest....
分类:
移动开发 时间:
2014-12-23 11:52:29
阅读次数:
180
(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_height="ma...
分类:
移动开发 时间:
2014-12-22 16:23:31
阅读次数:
192
(1)两种方法提冲Spinner中的数据源:通过list集合,或者是通过xml文件进行配置
(2)布局代码如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:lay...
分类:
移动开发 时间:
2014-12-22 16:18:26
阅读次数:
250
(1)首先实现AutoCompleteTextView功能所需要的适配器数据源共有两种方法,一种结果是手工配置的,另一汇总是通过xml文件制定的数据(当然也可以通过网上资源获得)
这里只讲前两种!
(2)布局的页面代码都一样如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xm...
分类:
移动开发 时间:
2014-12-21 22:14:18
阅读次数:
186
(1)选用radioGroup的图标
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:la...
分类:
移动开发 时间:
2014-12-21 19:29:37
阅读次数:
226
(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_heig...
分类:
移动开发 时间:
2014-12-21 19:26:12
阅读次数:
140
(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_h...
分类:
移动开发 时间:
2014-12-21 16:41:20
阅读次数:
203
1.尽量使用线性布局(LinearLayout)和相对布局(RelativeLayout),不要使用绝对布局。2.尽量使用dip和sp,不要使用px。3.为不同的分辨率提供不同的布局文件和图片。 例如: 4.在AndroidMainfest.xml中设置多分辨率支持。 1 总结一下: 1)...
分类:
移动开发 时间:
2014-12-20 23:22:07
阅读次数:
192
layout对于顺速搭建界面和适应不同的分辨率有很重要的作用,layout大致分成5种,LinearLayout ,FrameLayout , TableLayout ,RelativeLayout, AbsoluteLayout.1.几种Layout中Item所共有的XML属性:(1)layout...
分类:
其他好文 时间:
2014-12-19 11:56:39
阅读次数:
167