【发布时间】:2013-08-06 10:57:10
【问题描述】:
我想在用户单击应用程序图标时显示一个启动页面。为此,我创建了工作表并附加到页面。 main.qml
import bb.cascades 1.0
Page {
Container {
Label {
text: "Home page"
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
}
}
attachedObjects: [
Sheet {
id: mySheet
content: Page {
Label {
text: "Splash Page / Sheet."
}
}
}
]//end of attached objects
onCreationCompleted: {
//open the sheet
mySheet.open();
//After that doing some task here.
---------
---------
---------
//Now I'm closing the Sheet. But the Sheet was not closed.
//It is showing the Sheet/Splash Page only, not the Home Page
mySheet.close();
}
}//end of page
工作完成后,我想关闭工作表。所以我调用了close()方法。但是Sheet没有关闭。
如何在 oncreationCompleted() 方法或任何 c++ 方法中关闭工作表?
【问题讨论】:
-
您是否尝试在
mySheet.close();之前/之后添加日志,以确保您可以访问它? -
是的,我已经测试过了,它也在打印日志消息。
-
您的任务需要多长时间?当您尝试关闭工作表时,可能尚未完全打开工作表(动画可能未结束)。
-
我是 cascades 框架和 c++ 的新手。截至目前,我在打开工作表后没有做任何任务。只需打开工作表并关闭工作表。现在我试图在打开后关闭工作表。我已成功打开工作表,但无法关闭工作表。您能否建议我如何从 qml 或从 c++ 函数关闭工作表。
-
我想那是你的问题。我认为您必须等待
opened()(developer.blackberry.com/cascades/reference/…) 信号发出,然后才能关闭您的Sheet。
标签: c++ splash-screen blackberry-10 blackberry-cascades