小编use*_*822的帖子

Android:中心屏幕中的ImageView

我有一个全屏幕背景图片RelativeLayout.和其他图像(100x100)ImageView.

我想放在ImageView中心屏幕.但我的图像显示在左上方.

问题是什么?

XML

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/fondo_inicio" >

<ImageView android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_gravity="center"
    android:gravity="center"
    android:background="@drawable/icono_inicio"/>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

android image screen center imageview

-1
推荐指数
1
解决办法
7431
查看次数

标签 统计

android ×1

center ×1

image ×1

imageview ×1

screen ×1