2

我想为启动屏幕设置动画,与淡入淡出或滑动一些图片一样,我该如何为 android 项目执行此操作?

4

4 回答 4

3

这是一个很好的示例,其中包含特定启动页面的源代码:http: //www.codeproject.com/Articles/113831/An-Advanced-Splash-Screen-for-Android-App

自定义启动画面: 自定义启动画面 - Android

于 2012-11-01T06:30:37.680 回答
2

查看下面的链接
http://docs.xamarin.com/android/recipes/Other_UX/Animation/Frame_Animation

你必须在android中使用动画。使用 java 或 mono 没有区别

于 2012-11-01T05:51:29.690 回答
1

在 res 中创建 anim 文件夹,在其中创建一个 xml 文件示例:fade_in_anim.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <set xmlns:android="http://schemas.android.com/apk/res/android" >

<alpha
    android:duration="5000"
    android:fromAlpha="0.0"
    android:toAlpha="1.0" />

在java中声明动画

Animation _startAnimation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.fade_in_anim);

声明想要动画的视图

view.startAnimation(_startAnimation);
于 2012-11-01T06:07:45.183 回答
1

您可以在 Webview 中加载图像。

首先将您的 .gif 图像放在项目的 Assets 文件夹中并更改其 Build Action=>AndroidAssest

现在将您的 html 代码分配给字符串对象。

string myhtmldata = "<html xmlns=\"http://www.w3.org/1999/xhtml\">
<body bgcolor='#000000'><img src='image_name.gif' width=100%></body></html>";

在 Webview 中使用 Base URL 传递此字符串对象。

webview.LoadDataWithBaseURL("file:///android_asset/", myhtmldata, "text/html", "UTF-8", null);

它将在启动画面中显示 GIF 图像。!!

于 2016-09-19T07:39:41.260 回答