gpt4 book ai didi

android - 无法将 SlidingPaneLayout 设置为不可见

转载 作者:行者123 更新时间:2023-11-30 03:06:10 24 4
gpt4 key购买 nike

我正在尝试创建一个在滑动 Pane 中具有 MapFragment 的应用程序。 map 位于一个 fragment 上,该 fragment 滑开进入主要内容,一个 ListView。但是,我无法完全隐藏 MapFragment,因为在主视图中总有一部分可见。这是我的代码

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".MainActivity" >

<android.support.v4.widget.SlidingPaneLayout
android:id="@+id/sliding_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">


<ListView
android:id="@+id/postsView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left"
>
</ListView>


<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right"

/>


</android.support.v4.widget.SlidingPaneLayout>

</LinearLayout>

最佳答案

这就是 SlidingPaneLayout 的本质。它总是显示相对面板的一部分,以帮助向用户指示如何在面板之间切换。我在其 API 中看不到任何更改它的选项,尽管可能有一种方法可以通过样式来实现。

关于android - 无法将 SlidingPaneLayout 设置为不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21783717/

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