📌  相关文章
📜  jetpack compose navigation - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:23.305000             🧑  作者: Mango

代码示例2
val navController = rememberNavController()

NavHost(navController, startDestination = "profile") {
    composable("profile") { Profile(...) }
    composable("friendslist") { FriendsList(...) }
    ...
}

fun Profile(navController: NavController) {
    ...
    Button(onClick = { navController.navigate("friends") }) {
        Text(text = "Navigate next")
    }
    ...
}