我只想做一个导航抽屉。我得到了这些错误-
$ Error:(7, 23) No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_camera').
Error:(11, 23) No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_gallery').
Error:(15, 19) No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_slideshow').
Error:(23, 31) No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_share').
Error:(27, 31) No resource found that matches the given name (at 'icon' with value '@drawable/ic_menu_send'). 尝试遵循本教程- https://www.youtube.com/watch?v=ju837bQOBfg
下面是我的global.xml文件,其中包含错误
$<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<group android:checkableBehavior="single">
<item android:id="@+id/nav_first_layout"
android:icon="@drawable/ic_menu_camera"
android:title="First Layout"/>
<item android:id="@+id/nav_second_layout"
android:icon="@drawable/ic_menu_gallery"
android:title="Second Layout"/>
<item android:id="@+id/nav_third_layout"
android:icon="@drawable/ic_menu_slideshow"
android:title="Third Layout"/>
</group>
<item> android:title="Communicate">
<menu>
<item
android:id="@+id/nav_share"
android:icon="@drawable/ic_menu_share"
android:title="Share" />
<item
android:id="@+id/nav_send"
android:icon="@drawable/ic_menu_send"
android:title="Send" />
</menu>
</item>
</menu>
<!--</menu>-->
<!-- </item>-->
<!--<item android:id="@+id/action_settings"-->
<!--android:title="@string/action_settings"-->
<!--android:orderInCategory="100"-->
<!--app:showAsAction="never" />-->Here is the source code from the video
我也可以上传我的源代码。我是android studio的初学者,我现在唯一的目标是学习如何制作导航抽屉。任何替代的帮助,链接到更容易的教程或指向我出错的地方的指针将非常感谢!
发布于 2017-07-11 04:23:12
看起来你并没有导入画布本身。从你发布的关于视频源代码的链接中,导航到/NavigationDrawer/app/src/main/res/drawable-v21/,这里是所有可绘制文件的位置,只需将所有内容复制到此处并粘贴到可绘制文件夹下即可。
https://stackoverflow.com/questions/45020736
复制相似问题