我希望能够从屏幕底部打开列表视图,到接近中间高度。我不知道如何做到这一点。我只知道它只能通过片段来完成,并且我不知道如何在我的当前活动和XML中使用它。我想要的效果如下图所示:
我希望我的问题很清楚。我知道如何实现列表视图,但我不知道如何按照我想要的方式实现它(我的意思是出现和消失时不会干扰其他视图)。这个列表应该覆盖其他视图。
编辑: 包括我的XML文件,以便您可以查看我在设计方面做了什么。
![enter image description here](https://istack.dev59.com/3sx5M.webp)
编辑: 包括我的XML文件,以便您可以查看我在设计方面做了什么。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="content_desc_overlay"
android:src="@drawable/ic_launcher"
android:id="@+id/img_view"
/>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/iv_overlay"
android:src="@drawable/doom"
android:scaleType="matrix"
/>
</FrameLayout>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Open List"
android:id="@+id/btn_screenshot"
android:layout_gravity="right|top"
/>
</RelativeLayout>
有什么建议吗?如果有源代码会更好。谢谢。