在viewgroup执行:
public void snapToScreen(int whichScreen) {
whichScreen = Math.max(0, Math.min(whichScreen, getChildCount() - 1));
boolean changingScreens = whichScreen != mCurrentScreen;
mNext...
分类:
移动开发 时间:
2014-08-08 21:29:36
阅读次数:
521
首先这个控件应该是继承ViewGroup:
初始化:
public class MyGroup extends ViewGroup{
private Scroller mScroller;
private float mOriMotionX;
private float mLastMotionX;
private VelocityTracker mVelocityTracker;
...
分类:
移动开发 时间:
2014-08-08 18:10:06
阅读次数:
319
结构 继承关系 public class ScrollView extends FrameLayout java.lang.Object android.view.View android.view.ViewGroup android.widget.FrameLayout android.widget.ScrollView 类概述 一种可供用户滚动的层次...
分类:
移动开发 时间:
2014-08-07 19:25:00
阅读次数:
297
导论本文着重讲解Android3.0后推出的属性动画框架Property Animation——Animator。产生原因 3.0之前已有的动画框架——Animation存在一些局限性, Animation框架定义了透明度,旋转,缩放和位移几种常见的动画,而且控制的是整个View,实现原理是每次绘制视图时View所在的ViewGroup中的drawChild函数获取该View的Ani...
分类:
移动开发 时间:
2014-08-06 19:24:22
阅读次数:
417
1问题:FragmentStatePagerAdapter+viewpager第二次进入该fragment不显示数据解决方法:在含有ViewPager的Fragment的onCreateView方法中添加代码:if(view!=null){ ViewGroupparent=(ViewGroup)view.getParent(); if(parent!=null){ parent.removeView(view); } ret..
分类:
移动开发 时间:
2014-08-05 22:56:31
阅读次数:
302
?一、View和ViewGroup概念
?二、事件响应
?三、View的绘制
?四、自定义View控件
?五、View的3D绘制
?六、View动画
?七、焦点控制(略)...
分类:
移动开发 时间:
2014-08-05 11:27:04
阅读次数:
243
onInterceptTouchEvent:
onInterceptTouchEvent是在ViewGroup里面定义的。Android中的layout布局类一般都是继承此类的。onInterceptTouchEvent是用于拦截手势事件的,每个手势事件都会先调用onInterceptTouchEvent。
onTouchEvent:
onTouchEvent同样也是在view中...
分类:
移动开发 时间:
2014-08-04 14:32:47
阅读次数:
299
今天在做自定义ViewGroup中,出现了一下错误提示Use View.isInEditMode() in your custom views to skip code when shown in Eclipse具体解决方法:在eclipse error log中查看错误具体出现在哪一行,然后将if...
分类:
系统相关 时间:
2014-08-04 13:26:17
阅读次数:
319
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/38352503 ,本问出自【张鸿洋的博客】1、概述上一篇已经基本给大家介绍了如何自定义ViewGroup,如果你还不了解,请查看:Android 手把手教您自定ViewGroup ,本篇将使用上篇介绍的方法,给大家带来一个实例:实现FlowLayout,何为FlowLayout,如...
分类:
移动开发 时间:
2014-08-04 11:09:27
阅读次数:
369
ViewGroup---------------------------------LinearLayout、Relative Layout、AdapterView----------------------------ListView、GridView||(Adapter)|-----------...
分类:
其他好文 时间:
2014-08-03 22:54:36
阅读次数:
255