How to make ImageSwitcher fitxy like ImageView?

80 views Asked by At

I want to add multiple photos so I used ImageSwitcher. But I want the image to Fit the layout width and height, I tried fitxy like ImageView but it didn't work is there any way to do it?

  android:scaleType="fitXY"
1

There are 1 answers

0
Ananta Raha On

If you are using in xml, put ImageView with android:layout_height="match_parent" and android:layout_width="match_parent" inside ImageSwitcher. If you want to set scaleType, set it to those ImageViews.

If you are using in code, then set LayoutParams to the ImageView with ViewGroup.MATCH_PARENT in your ViewFactory, then ImageView.setScaleType() if you want.