tags:

views:

511

answers:

1

Greetings,

I have the following layout in Android. I'm trying to make it so the seekbar is displayed ontop of the image (I have some code that makes it visible and invisible(Or rather GONE).

I was wondering if anyone could tell me how to position it so that the seekbar goes over the imageview, therefore allowing the imageview to take up the entire screen.

Thanks

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<.imageOverlay android:id="@+id/surface"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" />

<RelativeLayout
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
>

<SeekBar
 android:id="@+id/seekbar"
 android:layout_width="100px"
 android:layout_height="wrap_content"
 android:layout_gravity="center_horizontal"
 android:max="255"/>

<ImageView
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:id="@+id/surfaceimage"
 android:scaleType="fitXY"
  />

+1  A: 

Got it working with the following - I added framelayout instead of linearlayout.

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<.imageOverlay android:id="@+id/surface"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" />


<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
 android:id="@+id/surfaceimage"
 android:scaleType="fitXY"
  />
  <SeekBar
android:id="@+id/seekbar"
android:layout_width="100px"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:max="255"/>


</FrameLayout>
</RelativeLayout>

steve