找到你要的答案

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

Q:我怎么好像瀑布的视图切换边界外的调整图片?

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?

我查看交换机(它包含2视图的水壶和关闭)

第一个图像是壶“关闭”,并且在实际viewswitcher外。

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

我已经试图改变水壶图像本身的大小-它没有帮助

我怎么能让它呆在视图切换界限?

answer1: 回答1:

Make you imageView scaleType centerInside and set adjustViewBounds as true

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

让你centerinside ImageView秤类型设置adjustviewbounds为真

android:scaleType="centerInside"
android:adjustViewBounds="true"
answer2: 回答2:

Apply this to your ImageView

android:adjustViewBounds="true"

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

android:scaleType="centerInside"

将其应用到您的图片

android:adjustViewBounds="true"

如果不正确缩放与fitxy,改变这个

android:scaleType="centerInside"
android  imageview  android-linearlayout  viewswitcher