Friday, April 29, 2011

How can I make my image scrollable? [Android Platform]

I have an image that takes up a lot more space than the android screen. I want the image to be presented full size and the user can move in any direction. Like a map.

Any suggestions?

From stackoverflow
  • Here is a tutorial I saw that did what you are describing http://www.anddev.org/scrolling_a_picture_horizontally_and_vertically-t3245.html

  • You can use a webview which gives this to you for free. I'm not sure why but when I tried using the loadData method it didn't work, but using loadDataWithBaseURL with a null URL did.

    With a webview your image can even be embedded in HTML. In the example below yourContent is simply a string.

    E.g.

    yourView.loadDataWithBaseURL(null, yourContent, "text/html", "UTF-8", null);
    

0 comments:

Post a Comment