Android 中类似 Twitter 的启动画面动画
Twitter-like splash screen animation in Android
如何在Android应用程序中实现类似Twitter启动画面动画(来自iOS Twitter版本)的效果?
有图书馆 https://github.com/callumboddy/CBZSplashView 但它仅供 iOS 使用。
THis link 可能对您有用,只需下载代码并按照 link 建议
您可以在代码中创建:
// create and customize the view
SplashView splashView = new SplashView(context);
// the animation will last 0.5 seconds
splashView.setDuration(500);
// transparent hole will look white before the animation
splashView.setHoleFillColor(Color.WHITE);
// this is the Twitter blue color
splashView.setIconColor(Color.rgb(23, 169, 229));
// a Twitter icon with transparent hole in it
splashView.setIconResource(R.drawable.ic_twitter);
// remove the SplashView from MainView once animation is completed
splashView.setRemoveFromParentOnEnd(true);
或 XML:
<com.yildizkabaran.twittersplash.view.SplashView
xmlns:app="http://schemas.android.com/apk/res/com.yildizkabaran.twittersplash"
android:id="@+id/splash_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:icon="@drawable/ic_twitter"
app:iconColor="@color/twitter_blue"
app:duration="500"
app:holeFillColor="@color/white"
app:removeFromParentOnEnd="true" />
然后到运行动画,只需调用:
--> 运行 动画和监听动画事件(listener可以留空)
splashView.splashAndDisappear(new ISplashListener(){
@Override
public void onStart(){
}
@Override
public void onUpdate(float completionFraction){
}
@Override
public void onEnd(){
}
});`
-希望你能找到答案。
如何在Android应用程序中实现类似Twitter启动画面动画(来自iOS Twitter版本)的效果? 有图书馆 https://github.com/callumboddy/CBZSplashView 但它仅供 iOS 使用。
THis link 可能对您有用,只需下载代码并按照 link 建议 您可以在代码中创建:
// create and customize the view
SplashView splashView = new SplashView(context);
// the animation will last 0.5 seconds
splashView.setDuration(500);
// transparent hole will look white before the animation
splashView.setHoleFillColor(Color.WHITE);
// this is the Twitter blue color
splashView.setIconColor(Color.rgb(23, 169, 229));
// a Twitter icon with transparent hole in it
splashView.setIconResource(R.drawable.ic_twitter);
// remove the SplashView from MainView once animation is completed
splashView.setRemoveFromParentOnEnd(true);
或 XML:
<com.yildizkabaran.twittersplash.view.SplashView
xmlns:app="http://schemas.android.com/apk/res/com.yildizkabaran.twittersplash"
android:id="@+id/splash_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:icon="@drawable/ic_twitter"
app:iconColor="@color/twitter_blue"
app:duration="500"
app:holeFillColor="@color/white"
app:removeFromParentOnEnd="true" />
然后到运行动画,只需调用:
--> 运行 动画和监听动画事件(listener可以留空)
splashView.splashAndDisappear(new ISplashListener(){
@Override
public void onStart(){
}
@Override
public void onUpdate(float completionFraction){
}
@Override
public void onEnd(){
}
});`
-希望你能找到答案。