Use android:layout_gravity="center"
.
See LayoutParams:
Place the object in the center of its container in both the vertical and horizontal axis, not changing its size.
PS: Since you wrap your ImageView
with a container in your child view, I believe you should add gravity property in the wrapper. That way the "container" is your main
, not the child view's wrapper.