user2737037 user2737037 - 1 year ago 80
Android Question

Put ImageView exactly over VideoView

I need to put a ImageView exactly over a VideoView.

When I use this code in a RelativLayout

<VideoView
android:id="@+id/videoView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />

<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />


the VideoView is shown on the top, the ImageView is centered vertically.
What can be done to also center the ImageView, that both Views are at the same position and have the same size, when a video and a picture with the same resolution are displayed?

Answer Source

I just replaced my RelativLayout with an FrameLayout and everything did well.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download