ScreenMatch是根据你的需要,生成需要适配的尺寸的文件,手机会根据屏幕相关参数自动寻找合适的尺寸文件
识别长宽对角线长度
android studio里添加插件--screenMatch
新建dimens.xml
找到需要是配的model直接右键找到ScreenMatch
下面可以配置你想要配置的分辨率
替换dimens.xml
<?xml version="1.0" encoding="UTF-8"?> <resources> <!-- Your custom size defind by references, can be writted in anywhere, any module, any values/*.xml, for example: --> <dimen name="common_margin">@dimen/dp_15</dimen> <!-- dp and sp values, must be defind in this file! --> <!-- view size,you can add if there is no one --> <dimen name="dp_m_60">-60dp</dimen> <dimen name="dp_m_30">-30dp</dimen> <dimen name="dp_m_20">-20dp</dimen> <dimen name="dp_m_12">-12dp</dimen> <dimen name="dp_m_10">-10dp</dimen> <dimen name="dp_m_8">-8dp</dimen> <dimen name="dp_m_5">-5dp</dimen> <dimen name="dp_m_2">-2dp</dimen> <dimen name="dp_m_1">-1dp</dimen> <dimen name="dp_0">0dp</dimen> <dimen name="dp_0_1">0.1dp</dimen> <dimen name="dp_0_5">0.5dp</dimen> <dimen name="dp_1">1dp</dimen> <dimen name="dp_1_5">1.5dp</dimen> <dimen name="dp_2">2dp</dimen> <dimen name="dp_2_5">2.5dp</dimen> <dimen name="dp_3">3dp</dimen> <dimen name="dp_3_5">3.5dp</dimen> <dimen name="dp_4">4dp</dimen> <dimen name="dp_4_5">4.5dp</dimen> <dimen name="dp_5">5dp</dimen> <dimen name="dp_6">6dp</dimen> <dimen name="dp_7">7dp</dimen> <dimen name="dp_8">8dp</dimen> <dimen name="dp_9">9dp</dimen> <dimen name="dp_10">10dp</dimen> <dimen name="dp_11">11dp</dimen> <dimen name="dp_12">12dp</dimen> <dimen name="dp_13">13dp</dimen> <dimen name="dp_14">14dp</dimen> <dimen name="dp_15">15dp</dimen> <dimen name="dp_16">16dp</dimen> <dimen name="dp_17">17dp</dimen> <dimen name="dp_18">18dp</dimen> <dimen name="dp_19">19dp</dimen> <dimen name="dp_20">20dp</dimen> <dimen name="dp_21">21dp</dimen> <dimen name="dp_22">22dp</dimen> <dimen name="dp_23">23dp</dimen> <dimen name="dp_24">24dp</dimen> <dimen name="dp_25">25dp</dimen> <dimen name="dp_26">26dp</dimen> <dimen name="dp_27">27dp</dimen> <dimen name="dp_28">28dp</dimen> <dimen name="dp_29">29dp</dimen> <dimen name="dp_30">30dp</dimen> <dimen name="dp_31">31dp</dimen> <dimen name="dp_32">32dp</dimen> <dimen name="dp_33">33dp</dimen> <dimen name="dp_34">34dp</dimen> <dimen name="dp_35">35dp</dimen> <dimen name="dp_36">36dp</dimen> <dimen name="dp_37">37dp</dimen> <dimen name="dp_38">38dp</dimen> <dimen name="dp_39">39dp</dimen> <dimen name="dp_40">40dp</dimen> <dimen name="dp_41">41dp</dimen> <dimen name="dp_42">42dp</dimen> <dimen name="dp_43">43dp</dimen> <dimen name="dp_44">44dp</dimen> <dimen name="dp_45">45dp</dimen> <dimen name="dp_46">46dp</dimen> <dimen name="dp_47">47dp</dimen> <dimen name="dp_48">48dp</dimen> <dimen name="dp_49">49dp</dimen> <dimen name="dp_50">50dp</dimen> <dimen name="dp_51">51dp</dimen> <dimen name="dp_52">52dp</dimen> <dimen name="dp_53">53dp</dimen> <dimen name="dp_54">54dp</dimen> <dimen name="dp_55">55dp</dimen> <dimen name="dp_56">56dp</dimen> <dimen name="dp_57">57dp</dimen> <dimen name="dp_58">58dp</dimen> <dimen name="dp_59">59dp</dimen> <dimen name="dp_60">60dp</