从文档中,我看到您可以像这样嵌套导航图:
NavHost(navController, startDestination = "home") {
...
// Navigating to the graph via its route ('login') automatically
// navigates to the graph's start destination - 'username'
// therefore encapsulating the graph's internal routing logic
navigation(startDestination = "username", route = "login") {
composable("username") { ... }
composable("password") { ... }
composable("registration") { ... }
}
...
}
Run Code Online (Sandbox Code Playgroud)
我想知道,如何在路线中传递参数,并使其可供导航图中的所有可组合项使用?
这是我当前的导航图:
navigation(
// I'd like to grab this parameter
route = "dashboard?classId={classId}",
startDestination = Route.ScreenOne.route) {
composable(Route.ScreenOne.route) {
// And then …Run Code Online (Sandbox Code Playgroud) 在我的 android 应用程序中,我使用 ObjectAnimator 来转换图像视图,如下所示:
ObjectAnimator transitionX = ObjectAnimator.ofFloat(v, "TranslationY", 190);
Run Code Online (Sandbox Code Playgroud)
在动画完成后,是否有像 fillAfter 这样的选项会将视图的位置重置为新位置?