- 首先在build.gradle中引入
implementation 'me.jessyan:autosize:1.1.2'
- 然后在AndroidManifest.xml中添加如下代码
<meta-data android:name="design_width_in_dp" android:value="360"/> <meta-data android:name="design_height_in_dp" android:value="640"/>
- 下载地址:https://github.com/taowuhua/AndroidAutoSize