我怎样才能显示图像在屏幕中心?图像、屏幕、中心

2023-09-04 13:26:27 作者:绕过山河错落

我要显示像第一个图像的图像,但我的图像显示像第二个形象。 我想显示的图像,例如第一幅图像,就像在屏幕和平等空间的顶部和底部先看看图像中心,但我的图像显示在屏幕上,并在上面没有空格没有中心。

I want to display the image like first image but my images are displaying like second image. I want to display images like first image, like center in screen and equal spaces top and bottom look first image, but my images are displaying not center in screen and no spaces in top.

我能做些什么像第一个图像的显示图像... 任何人都知道,请给该解决方案 感谢所有

What can I do for display image like first images... Anybody knows,please give solution for that Thanks All

推荐答案

刚刚成立安卓scaleType =中心 ImageView的的ImageBitmap, 或者设置机器人:layout_gravity =中心的ImageView 其父母在他的布局

Just set android:scaleType="center" to your ImageView for ImageBitmap, or set android:layout_gravity="center" to your ImageView for its layout in his parents.