請問放大了linearlayout ,如何讓linearlayout的寬高也放大呢?主要想放大后,滾動條可以預覽全部的內容。
如果我直接修改布局的大小,放大的中心點是從左上角開始的,不能從雙指縮放處進行放大?
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scaleScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
>
<LinearLayout
android:id="@+id/scaleLinearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:scaleX="2"
android:scaleY="2"
android:focusable="true">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="https://bbs.csdn.net/topics/@mipmap/p1" />
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="https://bbs.csdn.net/topics/@mipmap/p2" />
</LinearLayout>
</ScrollView>
uj5u.com熱心網友回復:
目前我用了兩種方式方式1:采用matrix縮放,這個可以實作雙指中心點進行縮放布局,但是放大后,不能通過滾動條預覽內容。上下部門都顯示不全,因為matrix不會影響高寬。
方式2:采用直接修改高寬實作縮放,但是這樣只能從左上角為中心進行放大,如果滾輪在下面體驗就很差。沒辦法在雙指處進行放大尺寸么?
求大神指教
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/228180.html
標籤:Android
下一篇:求助
