Is there a way to center an image horizontally based on another image? Could be from xml or coded.
For example one button on top and another button below (i.e. android:layout_below="@+id/button1"), but centered horizontally based on the first one.
Is there a way to center an image horizontally based on another image? Could be from xml or coded.
For example one button on top and another button below (i.e. android:layout_below="@+id/button1"), but centered horizontally based on the first one.
Is the second image the same size or smaller than the first? If so, you can align the left and right sides, and specify a centred fit...
<ImageView
android:id="@+id/secondImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/firstImage"
android:layout_alignLeft="@id/firstImage"
android:layout_alignRight="@id/firstImage"
android:scaleType="center" />