简体   繁体   中英

Image Scroll inside ImageView

So i have an image with dimensions of 6720x280, i want to put this image in the ImageView with dimensions of 280x280 and be able to scroll it on imageview touch (it is a product image, so basically i want to rotate the image inside the ImageView). So every time user drags ImageView image should rotate by 280px.

Here is a process of obtaining image:

  1. Image is stored on the web server
  2. User accesses product page
  3. Script pre-loads the image from the server and saves it to assets folder
  4. Using InputStream im opening image from assets folder
  5. Converting it to Drawable
  6. Updating ImageView with setImageDrawable

Since i'm new to android development, i don't know on how to approach this problem. So that's why i'm asking for help (at least, please, point me to the right direction), any help is really appreciated.

Thank you for your attention

PS Here is how it should look like: 在此处输入图片说明

This is how am i doing in HTML:

<div class="product_viewer" style="background-image: url('/assets/products/product_id.jpg'); background-position: -2800px 0px;"></div>

I am a newbie in android development too, but may be using a scrollview can help you. You can use addView method to add an imageview into a scrollview as i understood. Here is the developer guide for scrollview https://developer.android.com/reference/android/widget/ScrollView.html I hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM