Change the size of ImageView on zooming

后端 未结 8 2297
逝去的感伤
逝去的感伤 2021-02-14 01:15

I am using chrisbanes PhotoView to implement pinch zoom..Image zooms on pinching and double tapping but i can\'t see that my image streched to full screen on zooming..on zooming

相关标签:
8条回答
  • 2021-02-14 02:00

    I use imageviewtouch and have same problem. To solve it you can wrap imageview inside layout without any other children. Example :

    <LinearLayout
    android:id="@+id/layout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginBottom="200dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/toplayout">
    
        <com.android.volley.toolbox.NetworkImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scaleType="fitCenter"
        android:background="@android:color/transparent"
        android:id="@+id/imageitem"/>
    </LinearLayout>
    
    0 讨论(0)
  • 2021-02-14 02:01

    It is because the ImageView has a view height of "wrap_content". Change it to "match_parent" and set the scaleType of the image to be "centerInside" to fix your problem.

    0 讨论(0)
提交回复
热议问题