瀑布流布局结构: ScrollView * ------------------------------------------------------------ * | LinearLayout (horizontal) ...
分类:
移动开发 时间:
2014-11-26 18:30:58
阅读次数:
292
首先看一下LinearLayout布局中Layout_weight属性的作用:它是用来分配属于空间的一个属性,你可以设置他的权重。很多人不知道剩余空间是个什么概念,下面我先来说说剩余空间。看下面代码: 运行结果是:看上面代码:只有Bu...
分类:
移动开发 时间:
2014-11-26 15:41:21
阅读次数:
187
本质是通过复用控件达到性能优化。
1、通过
被复用控件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:o...
分类:
移动开发 时间:
2014-11-24 15:29:28
阅读次数:
232
勤能补拙是良训,一分辛劳一分才。
本讲内容:通知 Notification 和 通知管理器 NotificationManager
我们通过一个例子实现一个可更新进度的通知,代码的讲解都写在注释里了
下面是res/layout/activity_main.xml 布局文件:
<LinearLayout xmlns:android="http://schemas....
分类:
移动开发 时间:
2014-11-22 17:33:16
阅读次数:
191
此为测试所用,没有参考价值
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
a...
分类:
其他好文 时间:
2014-11-21 18:53:30
阅读次数:
265
布局linearLayout:LinearLayout是线性布局,通过设置orientaltion属性可以设置是竖直方向上的线性布局还是水平方向上的线性布局。竖直线性布局:android:orientation="vertical"水平线性布局:android:orientation="horizo...
分类:
移动开发 时间:
2014-11-21 17:51:14
阅读次数:
239
下面开始讲解:1.LinearLayout:线性布局,最常规的布局,在XML文件中我们只需要规定布局的大小,如width(宽),height(高)等值,还有orientation(方向),我们就可以把控件依次填入其中,控件就会按照我们规定的方向线性填入,这里不再多说,不懂的朋友请参考API文档或者查...
分类:
移动开发 时间:
2014-11-20 18:42:28
阅读次数:
303
本文主要解决自定义tabhost的实现,以及集成通过代码动态添加选项卡功能、选项卡水平自动滑动功能、以及通过手势来切换选项卡功能。
下面跟我一起来完成这个完美的解决方案:
1、定义tabwidget选项卡的布局:tab_button.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"...
分类:
移动开发 时间:
2014-11-19 18:51:04
阅读次数:
216
一个demo,在xml布局中,某一行的高度为其他行的一半。之前用layout_weight,得出的效果也不太理想。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_...
分类:
移动开发 时间:
2014-11-19 14:16:01
阅读次数:
243
在进行Android开发的时候,常常要用到View 的margin 属性。但有时候界面的UI元素需要根据业务逻辑来确定隐藏或者显示的状态时,之前设置margin会破坏之前的对齐效果。那么,这个时候该如何设置Android UI元素之间的间距呢?...
分类:
移动开发 时间:
2014-11-19 01:55:38
阅读次数:
310