摘要: 一、前言 在上一篇文章,介绍了View的坐标等基础知识,有了基础知识后,对下面内容的理解也将会容易很多。那么本文介绍的是View滑动的几种方式,这对于View来说,也是需要重要掌握的内容,因为用户无时无刻不在与View打交道,而主要途径有滑动,比如说:界面的切换等。 二、滑动方式 在Android中 阅读全文
posted @ 2016-06-25 14:29 zhou23 阅读(932) 评论(0) 推荐(0) 编辑
摘要: 一、简介 在安卓中,View代表视图,是安卓中十分重要的一个概念,重要程度不亚于四大组件,用户每时每刻都在与View打交道,包括展示数据、事件传递等。因此,熟练掌握View的应用以及原理是Android进阶的必经之路。最近笔者在学习任玉刚著的《Android 开发艺术探索》中的View的相关知识,便 阅读全文
posted @ 2016-06-25 13:59 zhou23 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 1.1 Activity 的生命周期全面分析 1.1.1 典型情况下的生命周期分析 onPause: 正在停止,正常情况下紧接着 onStop 就会被调用,然后新的 Activity 执行 onResume; 如果新 Activity 采用了透明主题,则不会调用 onStop,因为 onStop 意 阅读全文
posted @ 2016-06-12 22:12 zhou23 阅读(214) 评论(0) 推荐(0) 编辑
摘要: ``` public List letterCombinations(String digits) { LinkedList ans = new LinkedList(); if(digits == null || digits.length() == 0) return ans; String[] 阅读全文
posted @ 2016-06-12 20:11 zhou23 阅读(150) 评论(0) 推荐(0) 编辑
摘要: this使用范围 1、在类的方法定义中使用的this关键字代表调用该方法对象的引用。 2、当必须指出当前使用方法的对象是谁时,要使用关键字this。 3、有时使用this可以处理方法中成员变量和参数重名的情况。 4、this可以看做是一个变量,它的值是当前对象的引用。 注:this一般出现在方法中, 阅读全文
posted @ 2016-05-31 23:54 zhou23 阅读(144) 评论(0) 推荐(0) 编辑
摘要: ``` #include int main() { int a,b; scanf("%d %d",&a, &b); printf("%d\n",a+b); return 0; } ``` 阅读全文
posted @ 2016-05-21 23:31 zhou23 阅读(129) 评论(0) 推荐(0) 编辑
摘要: ``` public class Solution { public int threeSumClosest(int[] num, int target) { int result = num[0] + num[1] + num[num.length 1]; Arrays.sort(num); fo 阅读全文
posted @ 2016-05-21 16:17 zhou23 阅读(72) 评论(0) 推荐(0) 编辑
摘要: ``` public class Solution { public List threeSum(int[] num) { Arrays.sort(num); List res = new LinkedList(); for (int i = 0; i 0 && num[i] != num[i 1] 阅读全文
posted @ 2016-05-21 16:15 zhou23 阅读(111) 评论(0) 推荐(0) 编辑
摘要: ``` public class Solution { public String longestCommonPrefix(String[] strs) { if(strs == null || strs.length == 0) return ""; String pre = strs[0]; i 阅读全文
posted @ 2016-05-20 16:27 zhou23 阅读(117) 评论(0) 推荐(0) 编辑
摘要: ``` public class Solution { public int romanToInt(String s) { if(s == null || s.length() == 0) return 0; int len = s.length(); HashMap map = new HashMap(); map.put... 阅读全文
posted @ 2016-05-20 14:35 zhou23 阅读(95) 评论(0) 推荐(0) 编辑