Search code examples
androidimageviewandroid-linearlayoutviewswitcher

How do i adjust ImageView if it falls outside of view Switcher bounds?


hhh

i have view switcher(it contains 2 views of kettle - on and off)

the first image is kettle "off" , and it stays outside of actual viewSwitcher.

I tried fitXY, fixStart, fitCenter - did not help! Below is the layout of viewSwitcher kkk

I already tried to change the size of kettle image itself - it does not help

How do i make it stay in bounds of the view Switcher?


Solution

  • Make you imageView scaleType centerInside and set adjustViewBounds as true

    android:scaleType="centerInside"
    android:adjustViewBounds="true"