【问题标题】:SlidingDrawer handle not visibleSlidingDrawer 手柄不可见
【发布时间】:2012-03-20 10:38:03
【问题描述】:

我不明白为什么在这样的布局中黑框不填充 textview 和slidingdrawer 句柄元素之间的区域。

如果我交换嵌入式线性布局和滑动抽屉,我看不到句柄元素。

请帮我解决这个问题。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@android:color/white"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/event_tv_title"
        style="@style/EventTitle"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

   <SlidingDrawer
        android:id="@+id/event_sd"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:content="@+id/content"
        android:handle="@+id/handle"
        android:orientation="vertical"
        android:background="#00000000" >

       <TextView
           android:id="@+id/handle"
           style="@style/TheatreRow"
           android:text="@string/schedule"/>

       <TextView
           android:id="@+id/content"
           android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:text="text" />
    </SlidingDrawer>


    <LinearLayout 
       android:layout_width="fill_parent"
       android:layout_height="match_parent"
       android:background="@android:color/black">
    </LinearLayout>

</LinearLayout>

【问题讨论】:

    标签: android android-layout slidingdrawer


    【解决方案1】:

    请参阅此示例:This One.

    【讨论】:

    • 问题是如果我为 event_tv_title 设置 android:layout_height="fill_parent" 我的滑动抽屉不可见
    • 谢谢,我找到了解决方案。我应该使用 FrameLayout 作为根元素而不是 linearLayout。
    • @VasilYaroshevich:如果您找到解决方案,请接受答案,以便帮助其他人。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-19
    • 1970-01-01
    相关资源
    最近更新 更多