导航预览在Android Studio 3.2预览版中不可用

导航预览在Android Studio 3.2预览版中不可用,第1张

概述我有兴趣尝试AndroidStudio中显示的导航图.但是在导入googlesample后,我的预览不可用我使用的是AndroidStudio3.2PreviewCanary16<navigationxmlns:android="http://schemas.android.com/apkes/android"xmlns:app="http://schemas.android.com/apkes-auto"

我有兴趣尝试Android Studio中显示的导航图.但是在导入google sample后,我的预览不可用

我使用的是AndroID Studio 3.2 PrevIEw Canary 16

<navigation xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"    app:startDestination="@+ID/launcher_home">    <fragment        androID:ID="@+ID/launcher_home"        androID:name="com.androID.samples.arch.componentsbasicsample.StartFragment"        androID:label="Home">        <action            androID:ID="@+ID/end_action"            app:destination="@ID/end_dest" />    </fragment>    <fragment        androID:ID="@+ID/end_dest"        androID:name="com.androID.samples.arch.componentsbasicsample.EndFragment"        androID:label="End"        >    </fragment></navigation>

18/6/2018更新:

即使我重建项目它也不起作用.但是如果添加新屏幕,则会在预览模式下显示新屏幕

解决方法:

您应该单击导航编辑器中的“文本”选项卡(导航图的xml文件),然后添加:

tools:layout="@layout/layout_name"

内部目标元素.

应该是这样的:

<fragment    androID:ID="@+ID/someFragment"    androID:name="com.freesoulapps.navigationtest.fragments.someFragment"    androID:label="Some Fragment"    tools:layout="@layout/layout_name"></fragment>
总结

以上是内存溢出为你收集整理的导航预览在Android Studio 3.2预览版中不可用全部内容,希望文章能够帮你解决导航预览在Android Studio 3.2预览版中不可用所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1104839.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存