简体   繁体   English

请帮助我在Basic4Android

[英]Please Help Me In Basic4Android

I'm learning Basic4Android. 我正在学习Basic4Android。 I want to use animation when I want to go to another activity. 当我想去另一个活动时,我想使用动画。 I Paste anim (animation files' folder) in my project folder/objects/res/. 我将anim(动画文件'文件夹)粘贴到我的项目文件夹/ objects / res /中。

I wrote codes. 我写了代码。 When I compile my project, anim folder automatically be deleted. 编译项目时,会自动删除anim文件夹。 And then my emulator (You Wave) gives an error that there is no animation files. 然后我的模拟器(You Wave)给出了一个没有动画文件的错误。 My codes: 我的代码:

Sub Button1_Click
Activity.Finish
StartActivity("Menu")
AnimateLayout.SetAnimation("file3","file4")
End Sub

and my animation module codes: 和我的动画模块代码:

'Code module
Sub Process_Globals

End Sub

Sub SetAnimation(InAnimation As String, OutAnimation As String)
Dim r As Reflector
Dim package As String
Dim In, out As Int
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")

In = r.GetStaticField(File.DirAssets &"/anim",InAnimation)
out = r.GetStaticField(package & ".R$anim", OutAnimation)
r.Target = r.GetActivity
r.RunMethod4("overridePendingTransition", Array As Object(In, out), Array As 
String("java.lang.int", "java.lang.int"))
End Sub

What can I do? 我能做什么?

You should set the anim folder or anim file to "read only" before compiling from basic4android. 在从basic4android编译之前,您应该将anim文件夹或anim文件设置为“只读”。

I wish you good luck. 祝你好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM