Error inflating class Button in Android

前端 未结 5 1540
暗喜
暗喜 2021-01-05 16:19

I have an application with min sdk 16 up to 23. I want to use Material design as much as possible. It also has to be fullscreen app. AppCompat support library is included. N

5条回答
  •  有刺的猬
    2021-01-05 17:05

    As we discussed in the comment section, the problem is that the inflater somehow fails to recognize ?attr/font_medium, thus raising an exception.

    You can use the dimens.xml file to specify custom dimensions, like this:

     
        14sp
        16sp
        18sp
    
    

    and then in your styles.xml you refer to these values like this:

    
    

    As every other resource, dimens.xml can be placed in the according resource folders to accomodate to a specific device configuration (screen dimensions, density, language, etc.).

提交回复
热议问题