gpt4 book ai didi

java - android,屏幕底部的ImageView

转载 作者:行者123 更新时间:2023-12-02 04:09:21 25 4
gpt4 key购买 nike

尝试将 ImageView 放在屏幕底部,+ 合适的宽度。

适合宽度没问题,但图像接近其高度的一半太低。

猜测:Imageview 的 Y 是 centerBased 吗?

请不要利用“布局”解决方案,我寻找 X、y、高度、宽度解决方案。 :)

(在 iOS 中非常简单)

private void layout_imageBottom(ImageView imageV) {


imageV.setScaleType(ImageView.ScaleType.FIT_XY);
imageV.setX(0);
imageV.setMinimumHeight(imageV.getHeight());
imageV.setMaxHeight(imageV.getHeight());
Integer iS= Settings.getScreenSize(getApplicationContext()).x;
imageV.setMinimumWidth(Settings.getScreenSize(getApplicationContext()).x);
imageV.setMaxWidth(Settings.getScreenSize(getApplicationContext()).x);
imageV.setY(Settings.getScreenSize(getApplicationContext()).y - imageV.getHeight());

}

最佳答案

为什么不这样设置:

RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)imageV.getLayoutParams();
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);

imageV.setLayoutParams(params);

关于java - android,屏幕底部的ImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33944698/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com