ViewPager と Volley の NetworkImageView を使用して画像のギャラリーを作成しようとしています。ビューページャーと画像取得ですべてが正常に機能しています。しかし、ビットマップを NetworkImageView に入れると、画像は NetworkImageView のサイズに合わせて引き伸ばされません。私の他の ImageView では、scaleType の設定は問題なく機能します。
<com.android.volley.toolbox.NetworkImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="fitXY" />
私のxmlファイル
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;
}
}
私のJava
この問題について何か考えはありますか?また、scaleType を fitCenter に変更しようとしましたが、結果は同じです。前もって感謝します。