Where are all the standard Android icon resources?

前端 未结 8 1422
暗喜
暗喜 2020-12-04 20:53

I have just started writing my first ever Java/Android application, so forgive the total n00b question.

How do you access the the standard operating system icons suc

相关标签:
8条回答
  • 2020-12-04 21:13

    Someone may see this page useful for getting those icons... http://developer.android.com/design/style/iconography.html

    0 讨论(0)
  • I installed the Android SDK for Eclipse on Windows.

    Now I can find all ressources under "C:\Program Files\Android\android-sdk-windows\platforms\android-9\data\res..."

    0 讨论(0)
  • 2020-12-04 21:17

    try this instead:

             android:src="@android:drawable/ic_menu_camera"
    
    0 讨论(0)
  • 2020-12-04 21:18

    it is now possible to use vector assets to generate standard (or customised) icons for android.

    • Add 'com.android.tools.build:gradle:1.4.0-beta3' to your build.gradle file. (The stable version will be out in the coming weeks).
    • Add a vector asset by right-clicking res/drawable/ > New > Vector Asset. Android Studio provides a built-in viewer for you to pick your drawable.
    • Reference your icon like you usually do. Eg: android:icon="@drawable/ic_help_24dp"
    0 讨论(0)
  • 2020-12-04 21:18

    You can find the android.R.drawable images in your local SDK folder. (Tested using Android Studio 3.0)

    First have a look at the docs for the names of the drawables here: https://developer.android.com/reference/android/R.drawable.html

    Second either search your drive for one of those image names.png or type in the name of any of them into your Android Studio activity and right click (goto declaration) on it to view the image. Then you can also right click that image to copy the path. Then open that folder and look at all the PNG's there.

    Example on windows 10: android.R.drawable.star_big_on is located in user/AppData/Local/Android/Sdk/platforms/android-25/data/res/drawable-hdpi/star_big_on.png

    (Note also on windows AppData is a hidden folder so you may need to set your windows explorer to show hidden if you are clicking to open each folder)

    Also if you need to see material design icons / descriptions this is a good place to look: https://material.io/icons

    0 讨论(0)
  • 2020-12-04 21:24

    You can acces them via android.R.drawable.* or in xml by @android:drawable/something.

    0 讨论(0)
提交回复
热议问题