导航组件中动作和目的地的区别 [英] Difference between Actions and Destination in Navigation Component

查看:31
本文介绍了导航组件中动作和目的地的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问Android导航系统中Action和Destination有什么区别?

I would like to ask what is the difference between Action and Destination in the Android Navigation system?

https://developer.android.com/guide/navigation/navigation-入门

我能够同时使用(操作和目标)导航屏幕.我需要知道动作和目的地的用途是什么.

I able to navigate screens using both (Actions and Destination). I need to know What is the usage of actions and destinations.

谢谢.

推荐答案

虽然您可以同时使用操作和目的地来导航屏幕,但还是有区别的.

Though you can able to navigate screens using both actions and destination but there is difference.

根据谷歌按操作导航比按目的地导航有以下优点:

1) 您可以通过您的应用可视化导航路径

1) You can visualize the navigation paths through your app

2) Actions 可以包含你可以设置的附加关联属性,例如过渡动画、参数值和 backstack 行为

2) Actions can contain additional associated attributes you can set, such as a transition animation, arguments values, and backstack behavior

3) 您可以使用插件安全参数进行导航

3) You can use the plugin safe args to navigate

有关详细了解,请参阅此 google codelab 页面.

For detail understanding follow this google codelab page.

这篇关于导航组件中动作和目的地的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆