摘要: 翻译自:http://developer.android.com/reference/android/view/VelocityTracker.html参照自:http://blog.jrj.com.cn/4586793646,5298605a.htmlandroid.view.VelocityTr... 阅读全文
posted @ 2014-04-15 23:16 流动的存在 阅读(330) 评论(0) 推荐(0) 编辑
摘要: [java]view plaincopy/***包含了方法和标准的常量用来设置UI的超时、大小和距离*/publicclassViewConfiguration{//设定水平滚动条的宽度和垂直滚动条的高度,单位是像素pxprivatestaticfinalintSCROLL_BAR_SIZE=10;... 阅读全文
posted @ 2014-04-15 23:09 流动的存在 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Android的Scroller介绍正文 一、结构 public classScrollerextendsObject java.lang.Object android.widget.Scroller 二、概述 这个类封装了滚动操作。滚动的持续时间可以通过构造函数传递... 阅读全文
posted @ 2014-04-15 22:45 流动的存在 阅读(3877) 评论(0) 推荐(0) 编辑
摘要: event.getAction() 获得的返回值://触摸屏幕时刻caseMotionEvent.ACTION_DOWN: // = 0break;//触摸并移动时刻caseMotionEvent.ACTION_MOVE: // = 2break;//终止触摸时刻caseMotionEvent.AC... 阅读全文
posted @ 2014-04-15 22:23 流动的存在 阅读(1649) 评论(0) 推荐(0) 编辑
摘要: onInterceptTouchEvent和onTouchEvent调用时序onInterceptTouchEvent()是ViewGroup的一个方法,目的是在系统向该ViewGroup及其各个childView触发onTouchEvent()之前对相关事件进行一次拦截,Android这么设计的想... 阅读全文
posted @ 2014-04-15 22:03 流动的存在 阅读(311) 评论(0) 推荐(0) 编辑
摘要: 2012-10-18 11:071614人阅读评论(0)收藏举报 scrollTo()和scrollBy()都是View的public成员函数,使用这两个函数可以达到同样的目的,只是使用方式不同。 public void scrollBy (int x, int y),将View的Content偏移... 阅读全文
posted @ 2014-04-14 14:44 流动的存在 阅读(337) 评论(0) 推荐(0) 编辑
摘要: onMeasure方法在控件的父元素正要放置它的子控件时调用.它会问一个问题,“你想要用多大地方啊?”,然后传入两个参数——widthMeasureSpec和heightMeasureSpec. 它们指明控件可获得的空间以及关于这个空间描述的元数据. 比返回一个结果要好的方法是你传递View的高... 阅读全文
posted @ 2014-04-14 14:35 流动的存在 阅读(374) 评论(0) 推荐(0) 编辑
摘要: android view的setVisibility方法值的意思有三个值 visibility One of VISIBLE, INVISIBLE, or GONE.常量值为0,意思是可见的常量值为4,意思是不可见的常量值为8,意思是不可见的,而且不占用布局空间//设置显示tv_main_title... 阅读全文
posted @ 2014-04-14 13:56 流动的存在 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 第一个例子:demo1Main—>SecondActivity—>Main从流程上看就是从Main跳转到SecondActivity,再从SecondActivity返回到Main。也就是将子Activity的数据返回给父Activity。代码如下:publicclassMainextendsActivity{privateButtonbtn;privateTextViewrequest_text;privatefinalintFIRST_REQUEST_CODE=1;/**Calledwhentheactivityisfirstcreated.*/@Overridepublicv 阅读全文
posted @ 2014-04-09 16:57 流动的存在 阅读(744) 评论(0) 推荐(0) 编辑
摘要: 3.信息内容是一个简单的View类型创建dialog方法的代码如下:new AlertDialog.Builder(this).setTitle("请输入").setIcon( android.R.drawable.ic_dialog_info).setView( new EditText(this)).setPositiveButton("确定", null) .setNegativeButton("取消", null).show();4.信息内容是一组单选框创建dialog方法的代码如下:new AlertDialog.Build 阅读全文
posted @ 2014-04-09 16:11 流动的存在 阅读(212) 评论(0) 推荐(0) 编辑