Closed jimmy510s closed 4 years ago
Can you provide a code snipped of what you are doing?
Hi,
I have the zoom layout and inside i have a frame layout where i add images in order to create something like a floor plan dynamically. Everything works perfect. I can zoom, move etc but after all images have been placed (using code) i try to move to a specific point (using panTo()) but nothing happens. Only if i use panBy() the map moves but it's not what i want since i know the x,y of the item that i want o focus.
Hope this helps
<com.otaliastudios.zoom.ZoomLayout
android:id="@+id/zoomLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical|horizontal"
app:alignment="center"
app:hasClickableChildren="true"
app:maxZoom="3"
app:maxZoomType="zoom"
app:minZoom="1"
app:minZoomType="zoom"
app:oneFingerScrollEnabled="true"
app:overPinchable="false"
app:overScrollHorizontal="false"
app:overScrollVertical="false"
app:scrollEnabled="true"
app:transformation="centerCrop"
app:transformationGravity="center"
app:zoomEnabled="true">
<FrameLayout
android:id="@+id/beach_map_asset_container"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.otaliastudios.zoom.ZoomLayout>
Well, the actual java/kotlin code would be helpful.
I tried your XML on the demo app and I can not reproduce your issue. Make sure to use negative values when using panTo
, otherwise you are trying to move the content beyond the limits of the ZoomLayout
(the container) which is prevented by the overPinchable=false
setting.
Oh... i thought that i had to use positive values. Ok let me try with negative values.
Yes it works!!! Thank you very much!! :D
Hi,
I want to pan to a specific point but the method pan to doesn't seem to work. The only thing that works is panBy method. Do i need to set setContainerSize? my container is about 5000 width and 2000 hegiht.
Thank you