最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - Icons not appearing even after the file names are correct and images are in png format - Stack Overflow

programmeradmin5浏览0评论

This is my code for activity_main_drawer.xml file

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android=";
    xmlns:tools=";>

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_home"
            android:icon="@drawable/bbc"
            android:title="@string/bbc" />
        <item
            android:id="@+id/nav_gallery"
            android:icon="@drawable/aaj_tak"
            android:title="@string/aaj_tak" />
        <item
            android:id="@+id/nav_slideshow"
            android:icon="@drawable/cnn"
            android:title="@string/cnn" />
        <item
            android:id="@+id/foxNewsFragment"
            android:icon="@drawable/fox"
            android:title="@string/fox" />
        <item
            android:id="@+id/skyNewsFragment"
            android:icon="@drawable/sky"
            android:title="@string/sky" />
    </group>

    <item android:title="Upcoming">
        <menu>
            <item
                android:id="@+id/new_york_times"
                android:icon="@drawable/ny"
                android:title="@string/new_york_times" />
        </menu>
    </item>
</menu>

and below is the image of my output Navigation Drawer

What should I do?

I tried changing files' format and rebuilt my project. Only "CNN's" logo is appearing even if it has the same file format. I want the icons to appear for each section.

发布评论

评论列表(0)

  1. 暂无评论