1,采样比,颜色模式进行图片压缩
【1】添加布局文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="250dp" />
<TextView
android:textColor="#000"
android:id="@+id/text"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
【2】找到控件计算。
-
把大图放在drawable-nodpi中 (布局分辨率适配