第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

安卓動畫可自行旋轉圖像

安卓動畫可自行旋轉圖像

慕碼人2483693 2022-09-21 16:40:24
我想制作一個動畫,以便在自身上旋轉圖像(通過x軸)。就像這樣: 我以前沒有找到類似的東西,我已經嘗試了一些技巧,比如:public static void coinAnimation(final View v){    RotateAnimation anim = new RotateAnimation(0.0f, 360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);    anim.setInterpolator(new LinearInterpolator());    anim.setRepeatCount(Animation.INFINITE);    anim.setDuration(700);    v.startAnimation(anim);    new Handler().postDelayed(new Runnable() {        @Override        public void run() {            v.setAnimation(null);        }    }, 2000);}
查看完整描述

2 回答

?
BIG陽

TA貢獻1859條經驗 獲得超6個贊

這是答案,盡管它僅適用于3.0及更高版本。


1)創(chuàng)建一個名為“動畫師”的新資源文件夾。


2)創(chuàng)建一個新的.xml文件,我稱之為“翻轉”。使用以下 XML 代碼:


<?xml version="1.0" encoding="utf-8"?>

<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"

    android:valueFrom="0" android:valueTo="360" android:propertyName="rotationY" >

</objectAnimator>

不可以,對象動畫器標記不以大寫字母“O”開頭。


3) 使用以下代碼開始動畫:


ObjectAnimator anim = (ObjectAnimator) AnimatorInflater.loadAnimator(mContext, R.animator.flipping); 

anim.setTarget(A View Object reference goes here i.e. ImageView);

anim.setDuration(3000);

anim.start();


查看完整回答
反對 回復 2022-09-21
?
翻閱古今

TA貢獻1780條經驗 獲得超5個贊

這是一個偉大的圖書館與一堆動畫。


嘗試YoYo動畫任何類型的視圖。


在應用程序的生成.gradle 文件中添加以下依賴項


dependencies {

        compile 'com.android.support:support-compat:25.1.1'

        compile 'com.daimajia.easing:library:2.0@aar'

        compile 'com.daimajia.androidanimations:library:2.3@aar'

}

例:


YoYo.with(Techniques.FlipOutY)

.duration(700)

.repeat(5)   // If you want to do INFINITELY then set "-1" value here

.playOn(findViewById(R.id.edit_area));


查看完整回答
反對 回復 2022-09-21
  • 2 回答
  • 0 關注
  • 126 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號