Android xml reference within xml doesn't work

前端 未结 2 1784
悲哀的现实
悲哀的现实 2021-01-28 16:59

I want to apply the new material design to my android app and have a small problem with my xml file.

16dp


        
相关标签:
2条回答
  • 2021-01-28 17:26

    You are declaring item elements here, not dimen.
    For example this one works:

    <resources>
    
        <dimen name="activity_horizontal_margin">16dp</dimen>
        <dimen name="activity_vertical_margin">16dp</dimen>
    
        <dimen name="reference">@dimen/activity_horizontal_margin</dimen>
    
    </resources>
    
    0 讨论(0)
  • 2021-01-28 17:33

    you should use <dimen instead of <item and it should work

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