在开发过程中其实我们已经接触到了屏幕适配方面的相关知识,慢慢的总结归纳,剖析其原理。
使用相对布局
LinearLayout却不允许你精准的控制它子view的关系,子view在LinearLayout中只能简单一个接一个的排成行。如果你需要你的子view不只是简简单单的排成行的排列,更好的方法是使用RelativeLayout,它允许你指定你布局中控件与控件之间的关系。
尽量使用...
分类:
移动开发 时间:
2015-04-21 09:52:06
阅读次数:
164
在android中选择图片是一个很常见的功能,图片的来源通常情况下是从相机获取和从相册获取两种。
先来写一个简单的选择按钮和一个能显示图片的ImageView<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
andr...
分类:
移动开发 时间:
2015-04-20 20:58:02
阅读次数:
188
根据郭神的博客写了个小demo,详细的方法都卸载注释里了,先上效果图:
布局代码:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout...
分类:
系统相关 时间:
2015-04-20 15:05:12
阅读次数:
285
点击显示展开项,先看效果:
开始,1.先搞个XML显示主界面:
main_activity.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout...
分类:
移动开发 时间:
2015-04-19 17:58:06
阅读次数:
146
在android开发中LinearLayout很常用,LinearLayout的内控件的android:layout_weight在某些场景显得非常重要,比如我们需要按比例显示。android并没用提供table这样的控件,虽然有TableLayout,但是它并非是我们想象中的像html里面的tab...
分类:
其他好文 时间:
2015-04-18 21:48:34
阅读次数:
148
使用style替换背景,防止Activity黑色背景闪过1.原来的布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_...
分类:
移动开发 时间:
2015-04-17 22:25:19
阅读次数:
210
优化布局层次1.避免布局镶嵌过深(如下)<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_paren...
分类:
移动开发 时间:
2015-04-17 14:04:35
阅读次数:
183
效果图》》
布局》》》
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@draw...
分类:
其他好文 时间:
2015-04-17 13:58:13
阅读次数:
227
使用include标签复用布局- 1.include标签的作用
假如说我下图的这个布局在很多界面都用到了,我该怎么办?每个页面都写一遍的话,代码太冗余,并且维护难度加大。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas....
分类:
移动开发 时间:
2015-04-17 13:55:44
阅读次数:
170
仿照安卓原生自带的文件管理器开发,这里只是简单写了个demo,依据现有代码可以很轻松实现后续开发,效果图如下:
首先新建一个listview_item,学过适配器的同学应该都知道一会要这是干什么的,就是为了绘制每个列表项的界面,这里采用图标+文件名
listview_item.xml
<LinearLayout xmlns:android="http:/...
分类:
移动开发 时间:
2015-04-17 11:33:20
阅读次数:
128