I am trying to make a gallery of images using ViewPager and Volley's NetworkImageView. Everything is working fine with the viewpager and image retrieve. But when i put the bitmap in the NetworkImageView, the image is not stretched to fill the size of the NetworkImageView. With my other ImageView, setting the scaleType works just fine.
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY" />
My xml file
public static class SwipeFragment extends Fragment {
ImageLoader imageLoader = AppController.getInstance().getImageLoader();
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View swipeView = inflater.inflate(R.layout.swipe_fragment, container, false);
NetworkImageView imageView = (NetworkImageView) swipeView.findViewById(R.id.imageView);
Bundle bundle = getArguments();
int position = bundle.getInt("position");
if (imageLoader == null) {
imageLoader = AppController.getInstance().getImageLoader();
}
imageView.setImageUrl(fotoUrl.get(position), imageLoader);
return swipeView;
}
static SwipeFragment newInstance(int position) {
SwipeFragment swipeFragment = new SwipeFragment();
Bundle bundle = new Bundle();
bundle.putInt("position", position);
swipeFragment.setArguments(bundle);
return swipeFragment;
}
}
My java
Any idea about this problem? I have also tried to change the scaleType into fitCenter but still the same results. Thank you in advance.