gpt4 book ai didi

android - 如何在另一个布局上放置透明 View

转载 作者:行者123 更新时间:2023-11-29 16:57:54 25 4
gpt4 key购买 nike

我正在研究表面 View 。我想要我的表面 View 上有一个透明 View 。该透明 View 必须包含标题、描述和微调器三样东西以及一个按钮名称“开始”。如果不输入标题、描述和 Spinner 的菜单,就无法进入透明 View 下方的下一个布局。请帮我举一些例子..如何实现这种观点???这就是我想要的.. enter image description here

这是我的 Surfaceview 布局..

  <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".MainActivity">


<LinearLayout
android:id="@+id/suface_view_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">


<net.ossrs.yasea.SrsCameraView
android:id="@+id/glsurfaceview_camera"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" />

</LinearLayout>

最佳答案

使用FrameLayout代替RelativeLayout

 <?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

// Add other view

<LinearLayout
android:id="@+id/suface_view_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">


<net.ossrs.yasea.SrsCameraView
android:id="@+id/glsurfaceview_camera"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true" />

</LinearLayout>

</FrameLayout>

关于android - 如何在另一个布局上放置透明 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44172670/

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