一、关于布局适配1、不要使用绝对布局2、尽量使用match_parent 而不是fill_parent 。3、能够使用权重的地方尽量使用权重(android:layout_weight)4、如果是纯色背景,尽量使用android的shape 自定义。5、如果需要在特定分辨率下适配,可以在res目录上...
分类:
其他好文 时间:
2015-03-04 20:48:23
阅读次数:
212
第一步<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"
android:layout_height="match_parent"tools:context=".MainActivity">
<android.support.v4..
分类:
移动开发 时间:
2015-03-04 06:24:04
阅读次数:
185
Create a Linear Layout(创建一个线性布局)注释:android:orientation="vertical"水平线性布局,"horizontal"垂直水平线性 match_parent:This value declares that the view should expan...
分类:
其他好文 时间:
2015-03-03 20:11:56
阅读次数:
131
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_par...
分类:
移动开发 时间:
2015-03-03 11:42:19
阅读次数:
137
感谢极客学院的视频布局文件:<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
and..
分类:
移动开发 时间:
2015-03-02 19:16:05
阅读次数:
209
先看下XML布局文件
<EditText
android:id="@+id/et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/tv_cou...
分类:
移动开发 时间:
2015-02-28 18:38:34
阅读次数:
152
正常来说,在ScrollView添加一个ListView后在真机上只会显示ListView的一行多一点,我也不理解为什么会这样,后来我把ListView的layout_height改成400dip,而不是用match_parent和wrap_content,我发现这样的话ListView就显示的多了...
分类:
其他好文 时间:
2015-02-27 10:03:47
阅读次数:
129
XML布局<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:paddingBottom="@dimen/activity_vertical_margin"an..
分类:
其他好文 时间:
2015-02-27 01:34:17
阅读次数:
148
转自:http://www.uml.org.cn/mobiledev/201211221.asp今天,我着重讲解下如下三个内容:measure过程WRAP_CONTENT、MATCH_PARENT/FILL_PARENT属性的原理说明xml布局文件解析成View树的流程分析。希望对大家能有帮助。- ...
分类:
移动开发 时间:
2015-02-26 18:24:16
阅读次数:
367
一个原因是布局文件中,没有给列表显示的位置。
例如:下面的布局
android:id="@+id/list_find"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="@and...
分类:
移动开发 时间:
2015-02-26 11:45:36
阅读次数:
136