1.在 Android 平台绘制一张图片,使用至少3种不同的 APl,lmageView,SurfaceView,自定义 Vew
布局xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="250dp"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="match_parent"
android:gravity="center"
android:text="Task1.1使用ImageView展示图片"
android:layout_height="wrap_content">
</TextView>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/task1">
</ImageView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="250dp"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="match_parent"
android:gravity="center"
android:text="Task1.2使用SurfaceView展示图片"
android:layout_height="wrap_content">
</TextView>
<SurfaceView
android:id="@+id/surface_task"
android:layout_width="match_parent"
android:layout_height="match_parent">
</SurfaceView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="250dp"
tools:ignore="MissingConstraints">
<TextView
android:layout_width="match_parent"
android:gravity="center"
android:text="Task1.3使用自定义的View展示图片"
android