How to create a navigation drawer without support library

前端 未结 3 1564
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-01 16:59

I\'m working on a Android project that only support API level > 14. As a consequence, we don\'t use the Android Support Library.

I would like to use the navigat

相关标签:
3条回答
  • 2021-01-01 17:34

    From the looks of it, the ONLY DrawerLayout implementation comes from the SupportLib (ie. there is not another source of this code).

    Also, from the looks of it, it was introduced in API 19, so your API 14 min wouldn't be adequate anyway.

    Bottom line, you should just include the SupportLibrary, and move on with your life, there is no significant issue including this library, and it will be much more work to try and create a workaround.

    0 讨论(0)
  • 2021-01-01 17:38

    You simply use the support library as it contains the functionality you need. It does not matter that you do not want to use the other functionality contained within the library. It does contain the sliding menu that you want to use so just use it.

    The alternative is to write your own code or use a different library.

    Try not to think of the support library as "only for backwards compatibility". It provides functionality that is not included in the standard SDK's (such as ViewPager and SlidingDrawer)

    0 讨论(0)
  • 2021-01-01 17:38

    You can either extract it from the support library v4 source code or use 3rd party library like SlidingMenu

    There once was an alternative/official implementation called SlidingDrawer, however it is deprecated since API Level 17.

    This is not hard to understand, there are many fancy features which is not contained in the official SDK release. Just go for what you want and don't pay too much attention to where it is from.

    0 讨论(0)
提交回复
热议问题