Android中Property Animation屬性動(dòng)畫(huà)編寫(xiě)的實(shí)例教程
1、概述
Android提供了幾種動(dòng)畫(huà)類型:View Animation 、Drawable Animation 、Property Animation 。View Animation相當(dāng)簡(jiǎn)單,不過(guò)只能支持簡(jiǎn)單的縮放、平移、旋轉(zhuǎn)、透明度基本的動(dòng)畫(huà),且有一定的局限性。比如:你希望View有一個(gè)顏色的切換動(dòng)畫(huà);你希望可以使用3D旋轉(zhuǎn)動(dòng)畫(huà);你希望當(dāng)動(dòng)畫(huà)停止時(shí),View的位置就是當(dāng)前的位置;這些View Animation都無(wú)法做到。這就是Property Animation產(chǎn)生的原因,本篇?jiǎng)t來(lái)詳細(xì)介紹Property Animation的用法。
property 動(dòng)畫(huà)系統(tǒng)是相當(dāng)健壯的框架,它幾乎可以動(dòng)畫(huà)顯示任何對(duì)象。 你可以定義一個(gè)動(dòng)畫(huà)來(lái)定時(shí)改變?nèi)魏螌?duì)象的屬性值,不論該對(duì)象是否在屏幕上顯示。 property 動(dòng)畫(huà)將以一定的時(shí)間間隔修改屬性值(對(duì)象中的字段值)。 要實(shí)現(xiàn)動(dòng)畫(huà)顯示,你須指定對(duì)象的相應(yīng)屬性(比如對(duì)象的屏幕位置),以及動(dòng)畫(huà)時(shí)長(zhǎng)、動(dòng)畫(huà)時(shí)間間隔。
property 動(dòng)畫(huà)系統(tǒng)能讓你設(shè)定以下動(dòng)畫(huà)要素:
(1)持續(xù)時(shí)間:指定動(dòng)畫(huà)的持續(xù)顯示時(shí)間。默認(rèn)的時(shí)長(zhǎng)是300毫秒。
(2)圖像插值方式:指定屬性值的變化方式,表示為關(guān)于動(dòng)畫(huà)已顯示時(shí)間的函數(shù)。
(3)重復(fù)次數(shù)和方式:指定動(dòng)畫(huà)是否循環(huán)播放,以及重復(fù)的次數(shù)。還可以指定動(dòng)畫(huà)是否反向播放??梢栽O(shè)為先正向播放再反向回放,如此往復(fù)直至達(dá)到設(shè)定的重復(fù)次數(shù)。
(4)動(dòng)畫(huà)集合:你可以把動(dòng)畫(huà)分為多個(gè)邏輯組,以便實(shí)現(xiàn)同時(shí)播放、順序播放或間隔一段時(shí)間再播放。
(5)幀刷新間隔:指定動(dòng)畫(huà)幀的刷新頻率。默認(rèn)是每 10 ms刷新一次,但應(yīng)用程序?qū)嶋H可執(zhí)行的刷新頻率取決于系統(tǒng)整體的繁忙程度,以及系統(tǒng)對(duì)定時(shí)器的支持程度。
2、相關(guān)API
Property Animation故名思議就是通過(guò)動(dòng)畫(huà)的方式改變對(duì)象的屬性了,我們首先需要了解幾個(gè)屬性:
(1)Duration動(dòng)畫(huà)的持續(xù)時(shí)間,默認(rèn)300ms。
(2)Time interpolation:時(shí)間差值,乍一看不知道是什么,但是我說(shuō)LinearInterpolator、AccelerateDecelerateInterpolator,大家一定知道是干嘛的了,定義動(dòng)畫(huà)的變化率。
(3)Repeat count and behavior:重復(fù)次數(shù)、以及重復(fù)模式;可以定義重復(fù)多少次;重復(fù)時(shí)從頭開(kāi)始,還是反向。
(4)Animator sets: 動(dòng)畫(huà)集合,你可以定義一組動(dòng)畫(huà),一起執(zhí)行或者順序執(zhí)行。
(5)Frame refresh delay:幀刷新延遲,對(duì)于你的動(dòng)畫(huà),多久刷新一次幀;默認(rèn)為10ms,但最終依賴系統(tǒng)的當(dāng)前狀態(tài);基本不用管。
相關(guān)的類:
(1)ObjectAnimator 動(dòng)畫(huà)的執(zhí)行類,后面詳細(xì)介紹
(2)ValueAnimator 動(dòng)畫(huà)的執(zhí)行類,后面詳細(xì)介紹
(3)AnimatorSet 用于控制一組動(dòng)畫(huà)的執(zhí)行:線性,一起,每個(gè)動(dòng)畫(huà)的先后執(zhí)行等。
(4)AnimatorInflater 用戶加載屬性動(dòng)畫(huà)的xml文件
(5)TypeEvaluator 類型估值,主要用于設(shè)置動(dòng)畫(huà)操作屬性的值。
(6)TimeInterpolator 時(shí)間插值,上面已經(jīng)介紹。
總的來(lái)說(shuō),屬性動(dòng)畫(huà)就是,動(dòng)畫(huà)的執(zhí)行類來(lái)設(shè)置動(dòng)畫(huà)操作的對(duì)象的屬性、持續(xù)時(shí)間,開(kāi)始和結(jié)束的屬性值,時(shí)間差值等,然后系統(tǒng)會(huì)根據(jù)設(shè)置的參數(shù)動(dòng)態(tài)的變化對(duì)象的屬性。
3、ObjectAnimator實(shí)現(xiàn)動(dòng)畫(huà)
之所以選擇ObjectAnimator為第一個(gè)~~是因?yàn)?,這個(gè)實(shí)現(xiàn)最簡(jiǎn)單~~一行代碼,秒秒鐘實(shí)現(xiàn)動(dòng)畫(huà),下面看個(gè)例子:
布局文件:
<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:id="@+id/id_container" >
<ImageView
android:id="@+id/id_ball"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/mv"
android:scaleType="centerCrop"
android:onClick="rotateyAnimRun"
/>
</RelativeLayout>
很簡(jiǎn)單,就一張妹子圖片~
Activity代碼:
package com.example.zhy_property_animation;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
public class ObjectAnimActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.xml_for_anim);
}
public void rotateyAnimRun(View view)
{
ObjectAnimator//
.ofFloat(view, "rotationX", 0.0F, 360.0F)//
.setDuration(500)//
.start();
}
}
效果:

是不是一行代碼就能實(shí)現(xiàn)簡(jiǎn)單的動(dòng)畫(huà)~~
對(duì)于ObjectAnimator:
(1)提供了ofInt、ofFloat、ofObject,這幾個(gè)方法都是設(shè)置動(dòng)畫(huà)作用的元素、作用的屬性、動(dòng)畫(huà)開(kāi)始、結(jié)束、以及中間的任意個(gè)屬性值。
當(dāng)對(duì)于屬性值,只設(shè)置一個(gè)的時(shí)候,會(huì)認(rèn)為當(dāng)然對(duì)象該屬性的值為開(kāi)始(getPropName反射獲?。?,然后設(shè)置的值為終點(diǎn)。如果設(shè)置兩個(gè),則一個(gè)為開(kāi)始、一個(gè)為結(jié)束~~~
動(dòng)畫(huà)更新的過(guò)程中,會(huì)不斷調(diào)用setPropName更新元素的屬性,所有使用ObjectAnimator更新某個(gè)屬性,必須得有g(shù)etter(設(shè)置一個(gè)屬性值的時(shí)候)和setter方法~
(2)如果你操作對(duì)象的該屬性方法里面,比如上例的setRotationX如果內(nèi)部沒(méi)有調(diào)用view的重繪,則你需要自己按照下面方式手動(dòng)調(diào)用。
anim.addUpdateListener(new AnimatorUpdateListener()
{
@Override
public void onAnimationUpdate(ValueAnimator animation)
{
// view.postInvalidate();
// view.invalidate();
}
});
(3)看了上面的例子,因?yàn)樵O(shè)置的操作的屬性只有一個(gè),那么如果我希望一個(gè)動(dòng)畫(huà)能夠讓View既可以縮小、又能夠淡出(3個(gè)屬性scaleX,scaleY,alpha),只使用ObjectAnimator咋弄?
想法是不是很不錯(cuò),可能會(huì)說(shuō)使用AnimatorSet啊,這一看就是一堆動(dòng)畫(huà)塞一起執(zhí)行,但是我偏偏要用一個(gè)ObjectAnimator實(shí)例實(shí)現(xiàn)呢~下面看代碼:
public void rotateyAnimRun(final View view)
{
ObjectAnimator anim = ObjectAnimator//
.ofFloat(view, "zhy", 1.0F, 0.0F)//
.setDuration(500);//
anim.start();
anim.addUpdateListener(new AnimatorUpdateListener()
{
@Override
public void onAnimationUpdate(ValueAnimator animation)
{
float cVal = (Float) animation.getAnimatedValue();
view.setAlpha(cVal);
view.setScaleX(cVal);
view.setScaleY(cVal);
}
});
}
把設(shè)置屬性的那個(gè)字符串,隨便寫(xiě)一個(gè)該對(duì)象沒(méi)有的屬性,就是不管~~咱們只需要它按照時(shí)間插值和持續(xù)時(shí)間計(jì)算的那個(gè)值,我們自己手動(dòng)調(diào)用~
效果:

這個(gè)例子就是想說(shuō)明一下,有時(shí)候換個(gè)思路不要被API所約束,利用部分API提供的功能也能實(shí)現(xiàn)好玩的效果~~~
比如:你想實(shí)現(xiàn)拋物線的效果,水平方向100px/s,垂直方向加速度200px/s*s ,咋實(shí)現(xiàn)呢~~可以自己用ObjectAnimator試試~
(4)其實(shí)還有更簡(jiǎn)單的方式,實(shí)現(xiàn)一個(gè)動(dòng)畫(huà)更改多個(gè)效果:使用propertyValuesHolder
public void propertyValuesHolder(View view)
{
PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("alpha", 1f,
0f, 1f);
PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("scaleX", 1f,
0, 1f);
PropertyValuesHolder pvhZ = PropertyValuesHolder.ofFloat("scaleY", 1f,
0, 1f);
ObjectAnimator.ofPropertyValuesHolder(view, pvhX, pvhY,pvhZ).setDuration(1000).start();
}
4、ValueAnimator實(shí)現(xiàn)動(dòng)畫(huà)
和ObjectAnimator用法很類似,簡(jiǎn)單看一下用view垂直移動(dòng)的動(dòng)畫(huà)代碼:
public void verticalRun(View view)
{
ValueAnimator animator = ValueAnimator.ofFloat(0, mScreenHeight
- mBlueBall.getHeight());
animator.setTarget(mBlueBall);
animator.setDuration(1000).start();
}
給你的感覺(jué)是不是,坑爹啊,這和ValueAnimator有毛線區(qū)別~但是仔細(xì)看,你看會(huì)發(fā)現(xiàn),沒(méi)有設(shè)置操作的屬性~~也就是說(shuō),上述代碼是沒(méi)有任何效果的,沒(méi)有指定屬性~
這就是和ValueAnimator的區(qū)別之處:ValueAnimator并沒(méi)有在屬性上做操作,你可能會(huì)問(wèn)這樣有啥好處?我豈不是還得手動(dòng)設(shè)置?
好處:不需要操作的對(duì)象的屬性一定要有g(shù)etter和setter方法,你可以自己根據(jù)當(dāng)前動(dòng)畫(huà)的計(jì)算值,來(lái)操作任何屬性,記得上例的那個(gè)【我希望一個(gè)動(dòng)畫(huà)能夠讓View既可以縮小、又能夠淡出(3個(gè)屬性scaleX,scaleY,alpha)】嗎?其實(shí)就是這么個(gè)用法~
實(shí)例:
布局文件:
<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:id="@+id/id_container"
>
<ImageView
android:id="@+id/id_ball"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bol_blue" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="verticalRun"
android:text="垂直" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="paowuxian"
android:text="拋物線" />
</LinearLayout>
</RelativeLayout>
左上角一個(gè)小球,底部?jī)蓚€(gè)按鈕~我們先看一個(gè)自由落體的代碼:
/**
* 自由落體
* @param view
*/
public void verticalRun( View view)
{
ValueAnimator animator = ValueAnimator.ofFloat(0, mScreenHeight
- mBlueBall.getHeight());
animator.setTarget(mBlueBall);
animator.setDuration(1000).start();
// animator.setInterpolator(value)
animator.addUpdateListener(new AnimatorUpdateListener()
{
@Override
public void onAnimationUpdate(ValueAnimator animation)
{
mBlueBall.setTranslationY((Float) animation.getAnimatedValue());
}
});
}
與ObjectAnimator不同的就是我們自己設(shè)置元素屬性的更新~雖然多了幾行代碼,但是貌似提高靈活性~
下面再來(lái)一個(gè)例子,如果我希望小球拋物線運(yùn)動(dòng)【實(shí)現(xiàn)拋物線的效果,水平方向100px/s,垂直方向加速度200px/s*s 】,分析一下,貌似只和時(shí)間有關(guān)系,但是根據(jù)時(shí)間的變化,橫向和縱向的移動(dòng)速率是不同的,我們?cè)撜?shí)現(xiàn)呢?此時(shí)就要重寫(xiě)TypeValue的時(shí)候了,因?yàn)槲覀冊(cè)跁r(shí)間變化的同時(shí),需要返回給對(duì)象兩個(gè)值,x當(dāng)前位置,y當(dāng)前位置:
代碼:
/**
* 拋物線
* @param view
*/
public void paowuxian(View view)
{
ValueAnimator valueAnimator = new ValueAnimator();
valueAnimator.setDuration(3000);
valueAnimator.setObjectValues(new PointF(0, 0));
valueAnimator.setInterpolator(new LinearInterpolator());
valueAnimator.setEvaluator(new TypeEvaluator<PointF>()
{
// fraction = t / duration
@Override
public PointF evaluate(float fraction, PointF startValue,
PointF endValue)
{
Log.e(TAG, fraction * 3 + "");
// x方向200px/s ,則y方向0.5 * 10 * t
PointF point = new PointF();
point.x = 200 * fraction * 3;
point.y = 0.5f * 200 * (fraction * 3) * (fraction * 3);
return point;
}
});
valueAnimator.start();
valueAnimator.addUpdateListener(new AnimatorUpdateListener()
{
@Override
public void onAnimationUpdate(ValueAnimator animation)
{
PointF point = (PointF) animation.getAnimatedValue();
mBlueBall.setX(point.x);
mBlueBall.setY(point.y);
}
});
}
可以看到,因?yàn)閛fInt,ofFloat等無(wú)法使用,我們自定義了一個(gè)TypeValue,每次根據(jù)當(dāng)前時(shí)間返回一個(gè)PointF對(duì)象,(PointF和Point的區(qū)別就是x,y的單位一個(gè)是float,一個(gè)是int;RectF,Rect也是)PointF中包含了x,y的當(dāng)前位置~然后我們?cè)诒O(jiān)聽(tīng)器中獲取,動(dòng)態(tài)設(shè)置屬性:
效果圖:

有木有兩個(gè)鐵球同時(shí)落地的感覺(jué)~~對(duì),我應(yīng)該搞兩個(gè)球~~ps:物理公式要是錯(cuò)了,就當(dāng)沒(méi)看見(jiàn)哈
自定義TypeEvaluator傳入的泛型可以根據(jù)自己的需求,自己設(shè)計(jì)個(gè)Bean。
好了,我們已經(jīng)分別講解了ValueAnimator和ObjectAnimator實(shí)現(xiàn)動(dòng)畫(huà);二者區(qū)別;如何利用部分API,自己更新屬性實(shí)現(xiàn)效果;自定義TypeEvaluator實(shí)現(xiàn)我們的需求;但是我們并沒(méi)有講如何設(shè)計(jì)插值,其實(shí)我覺(jué)得把,這個(gè)插值默認(rèn)的那一串實(shí)現(xiàn)類夠用了~~很少,會(huì)自己去設(shè)計(jì)個(gè)超級(jí)變態(tài)的~嗯~所以:略。
5、監(jiān)聽(tīng)動(dòng)畫(huà)的事件
對(duì)于動(dòng)畫(huà),一般都是一些輔助效果,比如我要?jiǎng)h除個(gè)元素,我可能希望是個(gè)淡出的效果,但是最終還是要?jiǎng)h掉,并不是你透明度沒(méi)有了,還占著位置,所以我們需要知道動(dòng)畫(huà)如何結(jié)束。
所以我們可以添加一個(gè)動(dòng)畫(huà)的監(jiān)聽(tīng):
public void fadeOut(View view)
{
ObjectAnimator anim = ObjectAnimator.ofFloat(mBlueBall, "alpha", 0.5f);
anim.addListener(new AnimatorListener()
{
@Override
public void onAnimationStart(Animator animation)
{
Log.e(TAG, "onAnimationStart");
}
@Override
public void onAnimationRepeat(Animator animation)
{
// TODO Auto-generated method stub
Log.e(TAG, "onAnimationRepeat");
}
@Override
public void onAnimationEnd(Animator animation)
{
Log.e(TAG, "onAnimationEnd");
ViewGroup parent = (ViewGroup) mBlueBall.getParent();
if (parent != null)
parent.removeView(mBlueBall);
}
@Override
public void onAnimationCancel(Animator animation)
{
// TODO Auto-generated method stub
Log.e(TAG, "onAnimationCancel");
}
});
anim.start();
}
這樣就可以監(jiān)聽(tīng)動(dòng)畫(huà)的開(kāi)始、結(jié)束、被取消、重復(fù)等事件~但是有時(shí)候會(huì)覺(jué)得,我只要知道結(jié)束就行了,這么長(zhǎng)的代碼我不能接收,那你可以使用AnimatorListenerAdapter
anim.addListener(new AnimatorListenerAdapter()
{
@Override
public void onAnimationEnd(Animator animation)
{
Log.e(TAG, "onAnimationEnd");
ViewGroup parent = (ViewGroup) mBlueBall.getParent();
if (parent != null)
parent.removeView(mBlueBall);
}
});
AnimatorListenerAdapter繼承了AnimatorListener接口,然后空實(shí)現(xiàn)了所有的方法~
效果圖:

animator還有cancel()和end()方法:cancel動(dòng)畫(huà)立即停止,停在當(dāng)前的位置;end動(dòng)畫(huà)直接到最終狀態(tài)。
6、AnimatorSet的使用
實(shí)例:
布局文件:
<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:id="@+id/id_container"
>
<ImageView
android:id="@+id/id_ball"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/bol_blue" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="togetherRun"
android:text="簡(jiǎn)單的多動(dòng)畫(huà)Together" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="playWithAfter"
android:text="多動(dòng)畫(huà)按次序執(zhí)行" />
</LinearLayout>
</RelativeLayout>
繼續(xù)玩球~
代碼:
package com.example.zhy_property_animation;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
public class AnimatorSetActivity extends Activity
{
private ImageView mBlueBall;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.anim_set);
mBlueBall = (ImageView) findViewById(R.id.id_ball);
}
public void togetherRun(View view)
{
ObjectAnimator anim1 = ObjectAnimator.ofFloat(mBlueBall, "scaleX",
1.0f, 2f);
ObjectAnimator anim2 = ObjectAnimator.ofFloat(mBlueBall, "scaleY",
1.0f, 2f);
AnimatorSet animSet = new AnimatorSet();
animSet.setDuration(2000);
animSet.setInterpolator(new LinearInterpolator());
//兩個(gè)動(dòng)畫(huà)同時(shí)執(zhí)行
animSet.playTogether(anim1, anim2);
animSet.start();
}
public void playWithAfter(View view)
{
float cx = mBlueBall.getX();
ObjectAnimator anim1 = ObjectAnimator.ofFloat(mBlueBall, "scaleX",
1.0f, 2f);
ObjectAnimator anim2 = ObjectAnimator.ofFloat(mBlueBall, "scaleY",
1.0f, 2f);
ObjectAnimator anim3 = ObjectAnimator.ofFloat(mBlueBall,
"x", cx , 0f);
ObjectAnimator anim4 = ObjectAnimator.ofFloat(mBlueBall,
"x", cx);
/**
* anim1,anim2,anim3同時(shí)執(zhí)行
* anim4接著執(zhí)行
*/
AnimatorSet animSet = new AnimatorSet();
animSet.play(anim1).with(anim2);
animSet.play(anim2).with(anim3);
animSet.play(anim4).after(anim3);
animSet.setDuration(1000);
animSet.start();
}
}
這里寫(xiě)了兩個(gè)效果:
第一:使用playTogether兩個(gè)動(dòng)畫(huà)同時(shí)執(zhí)行,當(dāng)然還有playSequentially依次執(zhí)行~~
第二:如果我們有一堆動(dòng)畫(huà),如何使用代碼控制順序,比如1,2同時(shí);3在2后面;4在1之前等~就是效果2了
有一點(diǎn)注意:animSet.play().with();也是支持鏈?zhǔn)骄幊痰?,但是不要想著狂點(diǎn),比如 animSet.play(anim1).with(anim2).before(anim3).before(anim5); 這樣是不行的,系統(tǒng)不會(huì)根據(jù)你寫(xiě)的這一長(zhǎng)串來(lái)決定先后的順序,所以麻煩你按照上面例子的寫(xiě)法,多寫(xiě)幾行:
效果圖:

- Android App中使用SurfaceView制作多線程動(dòng)畫(huà)的實(shí)例講解
- 基于JS實(shí)現(xiàn)Android,iOS一個(gè)手勢(shì)動(dòng)畫(huà)效果
- Android中編寫(xiě)屬性動(dòng)畫(huà)PropertyAnimation的進(jìn)階實(shí)例
- Android自定義加載控件實(shí)現(xiàn)數(shù)據(jù)加載動(dòng)畫(huà)
- 詳解Android Material Design自定義動(dòng)畫(huà)的編寫(xiě)
- Android中播放Gif動(dòng)畫(huà)取巧的辦法
- Android模仿知乎的回答詳情頁(yè)的動(dòng)畫(huà)效果
- Android開(kāi)發(fā)之Animations動(dòng)畫(huà)用法實(shí)例詳解
- Android編程中Tween動(dòng)畫(huà)和Frame動(dòng)畫(huà)實(shí)例分析
- Android編程之簡(jiǎn)單逐幀動(dòng)畫(huà)Frame的實(shí)現(xiàn)方法
- 第三方開(kāi)源Android TickPlusDrawable狀態(tài)可以通過(guò)動(dòng)畫(huà)切換的按鈕
- 實(shí)例解析如何在Android應(yīng)用中實(shí)現(xiàn)彈幕動(dòng)畫(huà)效果
相關(guān)文章
android特賣列表倒計(jì)時(shí)卡頓問(wèn)題的解決方法
這篇文章主要為大家詳細(xì)介紹了android特賣列表倒計(jì)時(shí)卡頓問(wèn)題的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-09-09
Android TabLayout設(shè)置指示器寬度的方法
本篇文章主要介紹了Android TabLayout設(shè)置指示器寬度的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-04-04
android編程開(kāi)發(fā)之全屏和退出全屏的實(shí)現(xiàn)方法
這篇文章主要介紹了android編程開(kāi)發(fā)之全屏和退出全屏的實(shí)現(xiàn)方法,以實(shí)例形式較為詳細(xì)的分析了Android全屏及退出全屏的頁(yè)面布局與功能實(shí)現(xiàn)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-11-11
Android 使用viewpager實(shí)現(xiàn)無(wú)限循環(huán)(定時(shí)+手動(dòng))
這篇文章主要介紹了Android 使用viewpager實(shí)現(xiàn)無(wú)限循環(huán)(定時(shí)+手動(dòng))的相關(guān)資料,需要的朋友可以參考下2015-11-11
Android Studio下的APP目錄結(jié)構(gòu)詳解
這篇文章主要介紹了AndroidStudio下的APP目錄結(jié)構(gòu),本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-05-05
Android實(shí)現(xiàn)發(fā)送短信功能實(shí)例詳解
這篇文章主要介紹了Android實(shí)現(xiàn)發(fā)送短信功能的方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了Android實(shí)現(xiàn)發(fā)送短信的原理、步驟與相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2016-02-02
Android編程實(shí)現(xiàn)的簡(jiǎn)易路徑導(dǎo)航條功能示例
這篇文章主要介紹了Android編程實(shí)現(xiàn)的簡(jiǎn)易路徑導(dǎo)航條功能,結(jié)合實(shí)例形式分析了Android結(jié)合視圖、布局及路徑操作實(shí)現(xiàn)導(dǎo)航條功能的相關(guān)技巧,需要的朋友可以參考下2017-01-01
Android中捕獲TTextView文本中的鏈接點(diǎn)擊事件方法
這篇文章主要介紹了Android中捕獲TTextView文本中的鏈接點(diǎn)擊事件方法,本文給出了實(shí)現(xiàn)代碼和使用方法以及實(shí)現(xiàn)自己控制的方法,需要的朋友可以參考下2015-01-01
Android 實(shí)現(xiàn)高斯模糊效果且兼容低版本
這篇文章主要介紹了Android 實(shí)現(xiàn)高斯模糊效果且兼容低版本的相關(guān)資料,本文圖文并茂介紹的非常詳細(xì),需要的朋友可以參考下2016-09-09
Android如何使用圓形揭露動(dòng)畫(huà)巧妙地隱藏或顯示View詳解
Android開(kāi)發(fā)中會(huì)遇到不少顯示和隱藏的問(wèn)題,下面這篇文章主要給大家介紹了關(guān)于Android如何使用圓形揭露動(dòng)畫(huà)巧妙地隱藏或顯示View的相關(guān)資料,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-04-04

