0

I have to use SlidingDrawer in my app. I know this class is deprecated but it very useful to do what i want so i have decided to use it.

I've used this link

Android: can height of SlidingDrawer be set with wrap_content?

in order to use wrap_content when the SlidinDrawer is open. It works perfect on android 4.2.2 with AOSP rom but with android 4.0.4 on SGSII (Samsung rom), i have some display problem when i open or close the SlidingDrawer. If there is no action, the widget appears correctly.

Have you any idea why there is this problem ?

Edit : Here is a screenshot. The problem disappeared when i took a screenshot, so to see the problem i took a photo with another device. enter image description here

4

1 回答 1

1

SlidingDrawer 的替代品是“自定义滑动抽屉”。

Sephiroth创造了其中之一。它可以选择上下滑动。它有处理程序,用作打开和关闭滑动抽屉的实际句柄。

我会建议你实现这个自定义的。这将解决您的问题。

您只需要在布局中定义以下内容

<view class="it.sephiroth.demo.slider.widget.MultiDirectionSlidingDrawer"
     xmlns:my="http://schemas.android.com/apk/res/it.sephiroth.demo.slider"
     android:id="@+id/drawer"
     my:direction="topToBottom"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     my:handle="@+id/handle"
     my:content="@+id/content">

     <include android:id="@id/content"
         layout="@layout/pen_content" />

     <imageview android:id="@id/handle"
          android:layout_width="wrap_content"
          android:layout_height="40dp"
          android:src="@drawable/sliding_drawer_handle_bottom" />
</view>

而已。您的滑动抽屉已准备就绪。

于 2013-05-20T11:10:06.583 回答