屏幕适配
常规适配手段
使用像素密度无关的尺寸单位
- 避免写死控件,尽量多使用wrap_content、match_parent、weight
- 控件距离使用dp字体大小使用sp
- 不要用写死的px值
布局方面
- 使用相对布局,禁用绝对布局
- 使用约束布局ConstraintLayout
- 使用百分比布局
使用布局限定符
- 使用尺寸限定符 res/layout-large
- 使用最小宽度限定符 res/layout-sw600dp
- 使用可用宽度限定符 res/layout-w600dp
- 使用布局别名 res/layout/main.xmlres/layout/main_twopanes.xml
- 使用屏幕方向限定符 res/layout-landres/layout-sw600dp-land/