0

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?

ERJAN
  • 23,696
  • 23
  • 72
  • 146

2 Answers2

2

Apply this to your ImageView

android:adjustViewBounds="true"

If it's not scaled properly with fitXY, change it to this

android:scaleType="centerInside"
Bojan Kseneman
  • 15,488
  • 2
  • 54
  • 59
1

Make you imageView scaleType centerInside and set adjustViewBounds as true

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