简体   繁体   English

滑动抽屉源

[英]SlidingDrawer source

I imported the code for SlidingDrawer from here and created according attr.xml, the problem is, that in the source are still errors, namely fields mTop,mBottom,mLeft and mRight are not defined. 我从此处导入了SlidingDrawer的代码,并根据attr.xml创建了问题,问题是,在源代码中仍然存在错误,即未定义字段mTop,mBottom,mLeft和mRight。 How do I implement SlidingDrawer code ? 如何实现SlidingDrawer代码?

You may kick yourself for not realizing the answer first 您可能会因为没有先意识到答案而踢自己

You can use a getter instead 您可以改用吸气剂

For mTop use getTop() 对于mTop,请使用getTop()

For mBottom use getBottom() 对于mBottom,请使用getBottom()

For mLeft use getLeft() 对于mLeft,请使用getLeft()

For mRight use getRight() 对于mRight使用getRight()

Sliding Drawer is drepraced, you might use another library easier to use : BottomBarDrawer 取消了Drawing Drawer,您可以使用另一个更易于使用的库:BottomBarDrawer

https://github.com/MartinRajniak/BottomBarDrawer https://github.com/MartinRajniak/BottomBarDrawer

And for your error, it's because you don't add the handle id (button/imageview,whatever) to the slidingdrawer element. 对于您的错误,这是因为您没有将handle ID(无论按钮/图像视图如何)添加到slidedrawer元素中。 Like that : 像那样 :

<SlidingDrawer
        android:id="@+id/drawer"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:handle="@+id/handle"
        android:content="@+id/content">
        <Button
            android:id="@id/handle"
            android:layout_width="fill_parent"
            android:layout_height="50dip"
            android:text="ButtonHandler" />
        <ListView
            android:id="@id/content"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" />
    </SlidingDrawer>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM