Different values folders in android

后端 未结 2 1121
醉话见心
醉话见心 2020-11-22 10:46

I am creating different values folders in my app (values, values-ldpi, values-mdpi, values-hdpi, values-xhdpi, values-nodpi, values-w360dp-mdpi). B

2条回答
  •  再見小時候
    2020-11-22 11:23

    The approach you are using is a valid approach, but a little outdated. From HoneyComb, there is a new way to fix all of this. Your resources folder should now look like this:

    enter image description here

    Please refer to the link I have posted and familiarize yourself with Smallest Width concept.

    Hope this helps :)

    EDIT: Adding to this post, try to establish some kind of standardization in your dimens.xml, something like this:

    Doing this makes it easier to maintain code, plus it reduces the number of dimen folders. Normally rather than having values-hdpi, values-xhdpi, etc. files like values-sw480dp-xhdpi might have more values to adjust, but then again all of this is contextual.

提交回复
热议问题