1

我刚开始在 Basic4android 中编程。我创建了 2 个布局。飞溅搜索。我想显示启动布局约 2 秒,然后自动移动到搜索布局。这是我到目前为止的代码。

Sub Process_Globals

    Dim SplashTimer As Timer 

End Sub

Sub Activity_Create(FirstTime As Boolean)

    SplashTimer.Initialize("SplashTimer", 3000)
    SplashTimer.Enabled = True

    If FirstTime = True Then
        Activity.LoadLayout("splash")
    End If

End Sub

Sub SplashTimer_Tick
    Activity.LoadLayout("search")
End Sub

问题是即使它在 3 秒后移动到搜索布局,启动布局仍然在背景中可见。谁能告诉我如何纠正这个问题?

4

1 回答 1

2

您应该将初始布局加载到面板中(使用 Panel.LoadLayout)并将面板添加到活动中。

调用 Panel.RemoveView 以删除面板及其布局。

于 2012-06-19T18:08:24.807 回答