Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何制作android';在前景中可以看到哪个滑动抽屉?_Android_Android Layout_Slidingdrawer - Fatal编程技术网

如何制作android';在前景中可以看到哪个滑动抽屉?

如何制作android';在前景中可以看到哪个滑动抽屉?,android,android-layout,slidingdrawer,Android,Android Layout,Slidingdrawer,我在布局中添加滑动抽屉小部件时遇到了一个路障。我添加了它,一切都很好。问题是,当我有一个充满高度的布局时,滑动抽屉的把手不再可见。有没有一种方法可以通过将手柄放在前景中使其可见,或者是另一种方法来实现这一点 我正在使用的示例来自: 我从上面的站点编辑的所有内容都是下面的.xml文件。提前谢谢你,我会随时待命 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.an

我在布局中添加滑动抽屉小部件时遇到了一个路障。我添加了它,一切都很好。问题是,当我有一个充满高度的布局时,滑动抽屉的把手不再可见。有没有一种方法可以通过将手柄放在前景中使其可见,或者是另一种方法来实现这一点

我正在使用的示例来自:

我从上面的站点编辑的所有内容都是下面的.xml文件。提前谢谢你,我会随时待命

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/linear"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/textView1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Blah Blah Title"
        android:gravity="center"
        android:textSize="38dp"/>

    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

    </FrameLayout>

    <SlidingDrawer xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/drawer"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:handle="@+id/handle"
        android:content="@+id/content">

        <bear.exmaple.CustomView
            android:id="@+id/content"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
        </bear.exmaple.CustomView>


        <ImageView android:id="@id/handle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/tray_handle_normal" />

    </SlidingDrawer>

</LinearLayout>

我最终找到了这个问题的答案,它非常简单,只需将所有视图/布局添加到一个相对布局中,并确保滑动抽屉是最后添加的。以下是答案所在的链接: