need help, again
I tried to view a big image in its real size (not fit to screen) using ImageSwitcher. I set the ScaleType of ImageView to ScaleType.CENTER. It worked but i cant scroll the image, how can i do it?I tried setHorizontalScrollBarEnabled and setVerticalScrollBarEnabled but still not working
This is the source:
Using java Syntax Highlighting
- package com.nico.imageSwitcherTest;
- import java.net.URISyntaxException;
- import com.nico.imageSwitcherTest.R;
- import android.app.Activity;
- import android.net.ContentURI;
- import android.os.Bundle;
- import android.view.View;
- import android.view.ViewGroup.LayoutParams;
- import android.widget.ImageSwitcher;
- import android.widget.ImageView;
- import android.widget.ViewSwitcher;
- import android.widget.ImageView.ScaleType;
- public class ImageSwitcherTest extends Activity implements ViewSwitcher.ViewFactory {
- private ImageSwitcher mSwitcher;
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- mSwitcher = (ImageSwitcher) findViewById(R.id.switcher);
- mSwitcher.setFactory(this);
- try {
- mSwitcher.setImageURI(new ContentURI("/tmp/somebigsizepicture.png"));
- } catch (URISyntaxException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- public View makeView() {
- // TODO Auto-generated method stub
- ImageView i = new ImageView(this);
- i.setBackgroundColor(0xFF000000);
- i.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
- LayoutParams.FILL_PARENT));
- i.setScaleType(ScaleType.CENTER);
- return i;
- }
- }
Parsed in 0.036 seconds, using GeSHi 1.0.8.4
And here is the screenshot: (i want to be able to scroll or pan the image so i can see the rest of image)


but it works, thx a lot 
