Localization and drawables

后端 未结 3 975
遥遥无期
遥遥无期 2020-12-05 07:00

I want to localize an image by adding the folder res/drawable-hdpi-no, but I get an error stating \"invalid resource directory name\". What\'s up with this?

相关标签:
3条回答
  • 2020-12-05 07:03

    yes, it is possible by. drawable-de-rDE-ldpi,drawable-de-rDE-mdpi . use it

    0 讨论(0)
  • 2020-12-05 07:07

    As far as I remember, only certain res folders will work. You need to call it drawable-[language code]-r[capitalised localisation code] if I remember rightly. Pretty sure it's one of the Android Tutorials.

    Yeah here it is http://developer.android.com/resources/tutorials/localization/index.html

    0 讨论(0)
  • 2020-12-05 07:22

    Each Android resource can have configuration parts in its resource name. For example you might have a plain image on

    res/drawable
    

    and a image for a high DPI screen on

    res/drawable-hdpi
    

    Here hdpi is a Screen pixel density configration. A list of supported Android resource configurtions can be found from here

    http://developer.android.com/guide/topics/resources/providing-resources.html

    The order of configurations are important. They must be on specific order. Your original Norwegian language configuration is on a wrong place. Change

    res/drawable-hdpi-no
    

    to

    res/drawable-no-hdpi
    

    and it works.

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