Android Animations简介
一 、Animations简介
Animations提供了一系列的动画效果,这些效果可以应用于绝大多数的控件;
二、Animations的分类
第一类:TweenedAnimations,该类Animations提供了旋转,移动,淡入淡出和缩放等效果;
第二类:Frame-by-Frame Animations,这类Animations可以创建一个Drawable序列,这些Drawable可以按照指定的时间间歇一个个的显示;
TweenedAnimations介绍
(1)TweenedAnimations可以分为下面几类:
1. Alpha:淡入淡出效果
2. Scale:缩放效果
3. Rotate:旋转效果
4. Translate:移动效果
(2)Animations的使用方法:
一种是在Java代码中使用,另一种是定义在XML文件中;
(3)在Java代码中使用步骤为:
a) 创建一个AnimationSet对象;
b)根据需要创建相应的Animation对象;
c)根据软件动画的需求,为Animation对象设置相应的数据;
d)将Animation对象添加到AnimationSet对象当中;
e)使用控件对象开始执行AnimationSet;
而Animation在代码中对应的四个子类分别为:
AlphaAnimation、TranslateAnimation、ScaleAnimation、RotateAnimation
例子:
代码如下:
activity_main.xml
<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:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context="com.xiaozhang.animationtest.MainActivity" > <Button android:id="@+id/scaleButtonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:text="scale动画效果" /> <Button android:id="@+id/rotateButtonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@id/scaleButtonId" android:text="rotate动画效果" /> <Button android:id="@+id/alphaButtonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@id/rotateButtonId" android:text="alpha动画效果" /> <Button android:id="@+id/translateButtonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@id/alphaButtonId" android:text="translate动画效果" /> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageViewId" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="100dp" android:src="@drawable/icon" /> </LinearLayout> </RelativeLayout>
MainActivity.java
package com.xiaozhang.animationtest; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.RotateAnimation; import android.view.animation.ScaleAnimation; import android.view.animation.TranslateAnimation; import android.widget.ImageView; public class MainActivity extends Activity { private ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.imageViewId); imageView = (ImageView) findViewById(R.id.imageViewId); findViewById(R.id.rotateButtonId).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { AnimationSet animationSet = new AnimationSet(true); RotateAnimation rotateAnimation = new RotateAnimation( 0, 360, Animation.RELATIVE_TO_PARENT, 0.3f, Animation.RELATIVE_TO_PARENT, 0.3f); rotateAnimation.setDuration(1000); animationSet.addAnimation(rotateAnimation); imageView.startAnimation(animationSet); } }); findViewById(R.id.scaleButtonId).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { AnimationSet animationSet = new AnimationSet(true); ScaleAnimation scaleAnimation = new ScaleAnimation(1, 0.0f, 1, 0.0f, Animation.RELATIVE_TO_PARENT, 0.1f, Animation.RELATIVE_TO_PARENT, 0.1f); scaleAnimation.setDuration(1000); animationSet.addAnimation(scaleAnimation); imageView.startAnimation(animationSet); } }); findViewById(R.id.alphaButtonId).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // 创建一个AnimationSet对象 AnimationSet animationSet = new AnimationSet(true); // 创建一个AlphaAnimation对象 AlphaAnimation alphaAnimation = new AlphaAnimation(0, 1); // 设置整个动画执行所需要的时间 alphaAnimation.setDuration(2000); // 将AlphaAnimation对象添加到AnimationSet当中 animationSet.addAnimation(alphaAnimation); // 使用控件执行动画效果 imageView.startAnimation(alphaAnimation); } }); findViewById(R.id.translateButtonId).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { AnimationSet animationSet = new AnimationSet(true); TranslateAnimation translateAnimation = new TranslateAnimation( Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 1.0f); translateAnimation.setDuration(1000); animationSet.addAnimation(translateAnimation); imageView.startAnimation(translateAnimation); } }); } }
另外,Animation或AnimationSet有一系列的方法,如:
setDuration(long) :设置动画持续时间(单位:毫秒)
setFillAfter(boolean) :如果参数为true,则动画执行结束后,控件将停留在结束的状态
setFillBefore(boolean) :如果参数为true,则动画执行结束后,控件将回到执行前的状态
setStartOffset(long) :设置动画执行前的等待时间
setRepeatCount(int) :设置动画重复执行的次数
(4)使用XML文件来执行Animation;
a)在res文件夹下新建一个名为anim的文件夹;
b)为各个不同的效果分别创建xml文件,并首先加入set标签,标签代码如下:
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" > </set>
c)在该标签中分别加入rotate,alpha,scale或translate标签;
d)在代码当中使用AnimationUtils装载xml文件,并生成Animation对象;
例子如上,代码如下:
res/anim/alpha.xml
<?xml version="1.0" encoding="UTF-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" > <alpha android:duration="500" android:fromAlpha="1.0" android:startOffset="1000" android:toAlpha="0.0" /> </set>
res/anim/scale.xml
<?xml version="1.0" encoding="UTF-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" > <scale android:duration="2000" android:fromXScale="1.0" android:fromYScale="1.0" android:pivotX="50%" android:pivotY="50%" android:toXScale="0.0" android:toYScale="0.0" /> </set>
res/anim/rotate.xml
<?xml version="1.0" encoding="UTF-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" > <rotate android:duration="3000" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="+350" /> </set>
res/anim/translate.xml
<?xml version="1.0" encoding="UTF-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" > <translate android:fromXDelta="50%" android:toXDelta="100%" android:fromYDelta="0%" android:toYDelta="100%" android:duration="2000" /> </set>
MainActivity.java
package com.xiaozhang.animationtest; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; public class MainActivity extends Activity { private ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.imageViewId); imageView = (ImageView) findViewById(R.id.imageViewId); findViewById(R.id.rotateButtonId).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Animation animation = AnimationUtils.loadAnimation( MainActivity.this, R.anim.rotate); imageView.startAnimation(animation); } }); findViewById(R.id.scaleButtonId).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Animation animation = AnimationUtils.loadAnimation( MainActivity.this, R.anim.alpha); imageView.startAnimation(animation); } }); findViewById(R.id.alphaButtonId).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Animation animation = AnimationUtils.loadAnimation( MainActivity.this, R.anim.scale); imageView.startAnimation(animation); } }); findViewById(R.id.translateButtonId).setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { Animation animation = AnimationUtils.loadAnimation( MainActivity.this, R.anim.translate); imageView.startAnimation(animation); } }); } }
不过需注意的是:
rotate.xml文件中android:pivotX的值共有三种设置方法:
1.android:pivotX="50" 这种方法使用绝对位置定位;
2.android:pivotX="50%" 这种方法相对于控件本身定位;
3.android:pivotx="50%p" 这种方法相对于控件的父控件定位;
(5)AnimationSet介绍:
AnimationSet是Animation的子类;一个AnimationSet包含了一系列的Animation;
为AnimationSet设置一些常见属性后,这些属性会应用到AnimationSet中的每一个Animation中;
多种效果的例子:
代码如下:
res/anim/alpha_scale.xml
<?xml version="1.0" encoding="UTF-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" > <alpha android:duration="500" android:fromAlpha="1.0" android:startOffset="2000" android:toAlpha="0.0" /> <rotate android:duration="2000" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="360" /> <rotate android:duration="2000" android:fromDegrees="0" android:pivotX="50%" android:pivotY="50%" android:toDegrees="+350" /> <translate android:duration="2000" android:fromXDelta="0%" android:fromYDelta="0%" android:toXDelta="100%" android:toYDelta="100%" /> </set>
MainActivity.java
package com.xiaozhang.animationtest; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ImageView; public class MainActivity extends Activity { private ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.imageViewId); imageView = (ImageView) findViewById(R.id.imageViewId); findViewById(R.id.buttonId).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Animation animation = AnimationUtils.loadAnimation( MainActivity.this, R.anim.alpha_scale); imageView.startAnimation(animation); } }); } }
也可以使用AnimationSet来实现:
代码:
package com.xiaozhang.animationtest; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.AnimationSet; import android.view.animation.RotateAnimation; import android.widget.ImageView; public class MainActivity extends Activity { private ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.imageViewId); imageView = (ImageView) findViewById(R.id.imageViewId); findViewById(R.id.buttonId).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // Animation animation = AnimationUtils.loadAnimation( // MainActivity.this, R.anim.alpha_scale); // imageView.startAnimation(animation); AnimationSet animationSet = new AnimationSet(true); AlphaAnimation alpha = new AlphaAnimation(1.0f, 0.0f); RotateAnimation rotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); animationSet.addAnimation(alpha); animationSet.addAnimation(rotate); // 动画执行过程 用时2秒 animationSet.setDuration(2000); // 延迟一秒后,再执行程序 animationSet.setStartOffset(1000); imageView.startAnimation(animationSet); } }); } }
(6)Interpolator:定义了动画变化的速率,在Animations中有以下几种Interpolator;
AccelerateDelerateInterpolator,在动画开始与结束的地方速率改变比较慢,在中间的时间加速;
AccelerateInterpolator,在动画开始的地方速率比较慢,然后开始加速;
CycleInterpolator,动画循环播放特定的次数,速率改变沿着正弦曲线;
DecelerateInterpolator,在动画开始的地方速率改变比较慢,然后开始减速;
LinearInterolator,动画以均匀的速率改变;
在代码中可以这样设置:
AnimationSet animationSet = new AnimationSet(true); animationSet .setInterpolator(new AccelerateDecelerateInterpolator());
在XML文件中则是通过:
android:interpolator
(7)Frame-by-Frame Animations的使用方法
a)在res/drawable当中创建一个XML文件,用于定义Animations的动画序列;
b)为ImageView设置背景资源:imageView.setBackgroundResource(R.drawable.anim_pic);
c)通过ImageView得到AnimationDrawable:
AnimationDrawable animation = (AnimationDrawable) imageView .getBackground();
d)开始执行动画:animationDrawable.start();
代码如下:
MainActivity.java
package com.xiaozhang.animationtest; import android.app.Activity; import android.graphics.drawable.AnimationDrawable; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; public class MainActivity extends Activity { private ImageView imageView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.imageViewId); imageView = (ImageView) findViewById(R.id.imageViewId); findViewById(R.id.buttonId).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { imageView.setBackgroundResource(R.drawable.anim_pic); AnimationDrawable animation = (AnimationDrawable) imageView .getBackground(); animation.start(); } }); } }
anim_pic.xml
<?xml version="1.0" encoding="UTF-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false" > <item android:drawable="@drawable/pic1" android:duration="800"> </item> <item android:drawable="@drawable/pic2" android:duration="800"> </item> <item android:drawable="@drawable/pic3" android:duration="800"> </item> <item android:drawable="@drawable/pic4" android:duration="800"> </item> <item android:drawable="@drawable/pic5" android:duration="800"> </item> <item android:drawable="@drawable/pic6" android:duration="800"> </item> <item android:drawable="@drawable/pic7" android:duration="800"> </item> <item android:drawable="@drawable/pic8" android:duration="800"> </item> <item android:drawable="@drawable/pic9" android:duration="800"> </item> </animation-list>
activity_main.xml
<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" tools:context="com.xiaozhang.animationtest.MainActivity" > <Button android:id="@+id/buttonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="多张动画效果" /> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageViewId" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_marginTop="100dp" /> </LinearLayout> </RelativeLayout>
(8)LayoutAnimationController简介及使用:
a)LayoutAnimationController用于为一个layout里面的控件,或者是一个ViewGroup里面的控件设置动画效果;
b)每一个控件都有相同的动画效果;
c)这些控件的动画效果可以设置在不同的时间显示出来;
d)LayoutAnimationController可以在xml文件当中设置,也可以在代码中进行设置;
先看在XML文件中配置的效果:
具体步骤如下:
a)在res/anim文件夹中创建一个新文件,名为list_anim_layout.xml文件;
b)在布局文件中为ListView添加如下配置,目的是将动画效果应用到ListView上;
android:layoutAnimation="@anim/list_anim_layout"
代码如下:
layout/activity_main.xml
<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" tools:context="com.xiaozhang.animationtest.MainActivity" > <ListView android:id="@id/android:list" android:layout_width="match_parent" android:layout_height="wrap_content" android:layoutAnimation="@anim/list_anim_layout" android:scrollbars="vertical" /> <Button android:id="@+id/buttonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/android:list" android:text="test" /> </RelativeLayout>
anim/list_anim_layout.xml
<?xml version="1.0" encoding="utf-8"?> <layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android" android:animation="@anim/list_anim" android:animationOrder="normal" android:delay="0.5" />
动画样式list_anim.xml
<?xml version="1.0" encoding="UTF-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator" android:shareInterpolator="true" > <alpha android:duration="2000" android:fromAlpha="0.0" android:toAlpha="1.0" > </alpha> </set>
ListView显示的内容:item.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <TextView android:id="@+id/user_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="25sp" /> <TextView android:id="@+id/user_sex" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="25sp" /> </LinearLayout>
再来看在代码中使用LayoutAnimationController:
a)创建一个Animation对象:可以通过装载XML文件,或者直接使用Animation的构造函数创建Animation对象;
b)使用如下代码创建LayoutAnimationController对象:
LayoutAnimationController lac = new LayoutAnimationController(animation);
c)设置控件显示的顺序:
lac.setOrder(LayoutAnimationController.ORDER_NORMAL);
d)为ListView设置LayoutAnimationController属性:
listView.setLayoutAnimation(lac);
效果和上面类似,只是反过来:
看代码:
activity_main.xml
<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" tools:context="com.xiaozhang.animationtest.MainActivity" > <ListView android:id="@id/android:list" android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="vertical" /> <Button android:id="@+id/buttonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/android:list" android:text="test" /> </RelativeLayout>
而MainActivity.java只需要修改onClick方法就行了;
public void onClick(View v) { listView.setAdapter(buildListAdapter()); Animation animation = (Animation) AnimationUtils.loadAnimation( MainActivity.this, R.anim.list_anim); LayoutAnimationController lac = new LayoutAnimationController( animation); lac.setOrder(LayoutAnimationController.ORDER_REVERSE); lac.setDelay(0.5f); listView.setLayoutAnimation(lac); }
(9)AnimationListener简单介绍
a)AnimationListener是一个监听器,该监听器在动画执行的各个阶段会得到通知,从而调用相应的方法;
b)主要有三个方法:
onAnimationStart(Animation animation)
onAnimationRepeat(Animation animation)
onAnimationEnd(Animation animation)
下面看一个使用AnimationListener添加和移除控件的例子:
activity_main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/layoutId" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.xiaozhang.animationtest.MainActivity" > <Button android:id="@+id/addButtonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:text="添加动画" /> <Button android:id="@+id/deleteButtonId" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@id/addButtonId" android:text="删除动画" /> <ImageView android:id="@+id/imageViewId" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="100dp" android:src="@drawable/icon" /> </RelativeLayout>
MainActivity.java
package com.xiaozhang.animationtest; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; import android.view.animation.Animation.AnimationListener; import android.widget.ImageView; public class MainActivity extends Activity { private ImageView imageView; private ViewGroup viewGroup = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.imageViewId); imageView = (ImageView) findViewById(R.id.imageViewId); viewGroup = (ViewGroup) findViewById(R.id.layoutId); findViewById(R.id.addButtonId).setOnClickListener( new AddButtonListener()); findViewById(R.id.deleteButtonId).setOnClickListener( new RemoveButtonListener()); } class AddButtonListener implements OnClickListener { @Override public void onClick(View v) { //创建一个淡入效果的Animation对象 AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(2000); animation.setStartOffset(500); //创建一个新的ImageView ImageView imageViewAdd = new ImageView(MainActivity.this); imageViewAdd.setImageResource(R.drawable.icon); //将新的ImageView添加到iewGroup中 viewGroup.addView(imageViewAdd, new LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); imageViewAdd.startAnimation(animation); } } class RemoveButtonListener implements OnClickListener { @Override public void onClick(View v) { // 创建一个淡出效果的Animation对象 AlphaAnimation animation = new AlphaAnimation(1.0f, 0.0f); // 为Animation对象设置属性 animation.setDuration(1000); animation.setStartOffset(500); // 为Animation对象设置监听器 animation.setAnimationListener(new RemoveAnimationListener()); imageView.startAnimation(animation); } } private class RemoveAnimationListener implements AnimationListener { @Override public void onAnimationStart(Animation animation) { System.out.println("start"); } // 该方法在淡出效果执行结束之后被调用 @Override public void onAnimationEnd(Animation animation) { System.out.println("end"); // 从ViewGroup中删除掉ImageView控件 viewGroup.removeView(imageView); } @Override public void onAnimationRepeat(Animation animation) { System.out.println("repeat"); } } }
Android Animations简介的更多相关文章
- Android Studio 简介及导入 jar 包和第三方开源库方[转]
原文:http://blog.sina.com.cn/s/blog_693301190102v6au.html Android Studio 简介 几天前的晚上突然又想使用 Android Studi ...
- "浅谈Android"第一篇:Android系统简介
近来,看了一本书,名字叫做<第一行代码>,是CSDN一名博主写的,一本Android入门级的书,比较适合新手.看了书之后,有感而发,想来进行Android开发已经有一年多了,但欠缺系统化的 ...
- 【译】Android系统简介—— Activity
续上一篇,继续介绍Android系统.上一篇: [译]Android系统简介 本文主要介绍构建Android应用的一些主要概念: Activity Activity是应用程序中一个单独的有UI的页面( ...
- 被遗忘的Android mipmaps简介
被遗忘的 Android mipmaps 简介 [导读]已经发布的 Android Studio1.1 版本是一个 bug 修复版本.在这个版本中,当你创建工程时一项改变将会吸引你的眼球.工程创建登陆 ...
- Android系统简介(中):系统架构
Android的系统架构栈分为4层,从上往下分别是Applications.Application framework.Libraries & Android Runtime.Linux ...
- Android系统简介(上):历史渊源
上个月,看到微信的一系列文章,讲到Linux的鼻祖-李纳斯的传记<Just for Fun>, 其人神乎其能, 其人生过程非常有趣,值得每个程序员细细品味. 而实际上,对我而已,虽然做软件 ...
- Android ART简介
一. Android ART简介 Android DEX/ODEX/OAT文件
- Android Animations 视图动画使用详解!!!
转自:http://www.open-open.com/lib/view/open1335777066015.html Android Animations 视图动画使用详解 一.动画类型 Andro ...
- Android插件简介
/** * @actor Steffen.D * @time 2015.02.06 * @blog http://www.cnblogs.com/steffen */ Android插件简介 Andr ...
随机推荐
- LA 4794 - Sharing Chocolate dp
题意 有一块\(x*y\)的巧克力,问能否恰好分成n块,每块个数如下 输入格式 n x y a1 a2 a3 ... an 首先\(x \times y 必然要等于 \sum\limits_{i=1} ...
- Hadoop分布式文件系统HDFS详解
Hadoop分布式文件系统即Hadoop Distributed FileSystem. 当数据集的大小超过一台独立的物理计算机的存储能力时,就有必要对它进行分区(Partition)并 ...
- 自定义控件(视图)2期笔记01:自定义控件之自定义View的步骤
1. 根据Android Developers官网的介绍,自定义控件你需要以下的步骤: (1)创建View (2)处理View的布局 (3)绘制View (4)与用户进行交互 (5)优化已定义的Vie ...
- tomcat程序记录客户端真实IP
需求: 开发告知:让后端tomcat日志获取真实的IP,而不是nginx 服务器的IP tomcat前面是nginx做的反向代理,所以tomcat取到的是nginx的ip. 日志名称是localhos ...
- Visual Studio 2015开发Android App问题集锦
Visual Studio 2015开发Android App 启动调试始终无法完成应用部署的解决方案 创建一个Android App项目后,直接启动调试发现Visual Studio Emulato ...
- angular 指令 要点解析
指令可以删繁就简前端的js代码,杜绝重复的js代码和html代码. 下面就对指令的重要属性进行罗列 一.restrict = 'AECM' 分别指该指令标识位于 attribute属性: < ...
- Oracle 大数据处理(一)
数据量: 日数据 2000万 月数据 8000万 处理方式:建立父子分区,采用Range+list模式分区,日期作为主分区,地域作为子分区 索引选择: 由于应用于查询比较多,故建立位图索引,效率 ...
- js中关于一个数组中最大、最小值以及它们的下标的输出的一种解决办法
今天在学习js中的数组时,遇到的输出一个数组中最大.最小值以及它们的下表,以下是自己的解决方法! <script type="text/javascript"> var ...
- (一)Knockout - 入门
knockout 简介 knockoutjs的实现依照[MVVM模式],Model-View-ViewModel. Model,用来聚合server端数据 ViewModel,描述的数据以及操作,是行 ...
- JS nodeType返回类型(复制的
http://blog.csdn.net/qyf_5445/article/details/9232907 将HTML DOM中几个容易常用的属性做下记录: nodeName.nodeValue 以及 ...