android eclipse using string resource for text size in layouts

后端 未结 2 703
攒了一身酷
攒了一身酷 2021-01-13 04:23

I want to be able to store a font size (18sp) in a resource so that a lot of my layouts will use so that I can easily change the size in the future if I need to. I\'ve a st

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-13 04:58

    Create a dimens.xml file in your res directory with contents similar to this:

    
    
        18dp
    
    

    Then instead of referencing it like @string/blah, use @dimen/blah.

提交回复
热议问题