Поместить SeekBar поверх Imageview в Android? - PullRequest
4 голосов
/ 16 декабря 2009

Привет,

У меня есть следующий макет в Android. Я пытаюсь сделать так, чтобы панель поиска отображалась поверх изображения (у меня есть некоторый код, который делает его видимым и невидимым (или, скорее, ушел).

Мне было интересно, может ли кто-нибудь сказать мне, как расположить его так, чтобы панель поиска проходила по изображению, поэтому просмотр изображения занимал весь экран.

Спасибо

<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 Ответ

3 голосов
/ 16 декабря 2009

Получилось работать со следующим - я добавил framelayout вместо 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>

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...