<?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" andr ...
分类:
其他好文 时间:
2016-05-18 10:21:03
阅读次数:
280
大家知道,自定义View有三个重要的步骤:measure,layout,draw。而measure处于该链条的首端,占据着极其重要的地位;然而对于measure的理解却不是那么容易,许多问题都是一知半解,比如:为什么父View影响到了子View的MeasureSpec的生成?为什么我们自定义一个View在布局时将其宽或者高指定为wrap_content但是其实际是match_parent的效果?子V...
分类:
其他好文 时间:
2016-05-13 14:44:03
阅读次数:
226
View的测量会回调onMeasure方法,因此首先要复写onMeasure方法,这个方法的作用进行宽高的测量,然后必须调用setMeasuredDimension进行设置,不然会触发IllegalStateException异常不复写此方法,默认采用EXACTLY模式测量,而EXACTLY只支持match_parent和指定的尺寸,指定为wrap_content的话无效,因为wrap_conten...
分类:
移动开发 时间:
2016-05-13 03:40:39
阅读次数:
195
我们看一下下面的代码<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="...
分类:
其他好文 时间:
2016-05-12 23:53:03
阅读次数:
325
实现思路:将手势写入GestureLibrary中,对其他手势进行匹配对比,进行识别
现在布局中加入GestureOverlayView组件
<android.gesture.GestureOverlayView
android:id="@+id/add_gesture"
android:layout_width="match_parent"
andr...
分类:
移动开发 时间:
2016-05-12 23:27:02
阅读次数:
170
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="match_parent"android:ba...
分类:
微信 时间:
2016-05-12 20:19:21
阅读次数:
441
自定义view
布局
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_verti...
分类:
其他好文 时间:
2016-05-12 20:02:07
阅读次数:
311
先上效果图
加载完数据
首先定义一个底部正在加载的布局footer_layout.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_p...
分类:
移动开发 时间:
2016-05-12 19:39:03
阅读次数:
397
电话窃听器
用服务开发
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout...
分类:
移动开发 时间:
2016-05-12 18:44:34
阅读次数:
245
android :id= "@+id/root"
android :layout_width= "match_parent"
android :layout_height= "match_parent"
android :columnCount= "4"
android :rowCount= "6">
android :layout_width...
分类:
其他好文 时间:
2016-05-12 18:25:59
阅读次数:
274