直接使用ScrollView加個ImageView就可以了,非常簡單
<?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:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context=".MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:fillViewport="true">
<ImageView
android:id="@+id/iv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitStart"
android:src="@drawable/a"
tools:ignore="MissingConstraints"
android:adjustViewBounds="true">
</ImageView>
</ScrollView>
</LinearLayout>

效果圖

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/388392.html
標籤:其他
下一篇:Android開發環境的配置流程
