How to use dimens.xml in Android?

前端 未结 6 2011
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 01:01

When I design a layout, I centralize all dimensions in dimens.xml because of topics of maintainability. My question is if this is correct or not. What would it be the best g

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 01:46

    But about dimensions?
    

    According to the official Android docs "A dimension is a simple resource that is referenced using the value provided in the name attribute (not the name of the XML file). As such, you can combine dimension resources with other simple resources in the one XML file, under one element"

    For more details refer to http://developer.android.com/guide/topics/resources/more-resources.html

    In this post, Devunwired gives three great reasons as to why use dimens.xml When should the dimens.xml file be used in Android?

提交回复
热议问题