gpt4 book ai didi

android - 在 Android 中将 SeekBar 置于 Imageview 之上?

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:10:10 26 4
gpt4 key购买 nike

问候,

我在 Android 中有以下布局。我正在努力做到这一点,以便搜索栏显示在图像之上(我有一些代码可以使它可见和不可见(或者更确切地说是消失)。

我想知道是否有人可以告诉我如何定位它,以便搜索栏越过 imageview,从而允许 imageview 占据整个屏幕。

谢谢

<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"
/>

最佳答案

它与以下内容一起工作 - 我添加了 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>

关于android - 在 Android 中将 SeekBar 置于 Imageview 之上?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1916665/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com