我正在使用带有样式“ NoActionBar”的 AppCompat v21
,并在 onCreate
中添加了一个操作/工具栏。
此外,还添加了Feinstein的SlidingMenu,这导致Activity(因此内部Fragment)与Android的导航按钮重叠(未完全显示,底部被切断)
如果我添加:
android:layout_marginBottom="48dp"
在布局中,一切都是可见的(当然)。
在Android 4.4上,一切都正常显示。
在使用支持库的Android L上,我错过了什么?
在onCreate中添加SlidingMenu:
super.onCreate(..)
setContentView(..)
menu = new SlidingMenu(this);
menu.setMode(SlidingMenu.LEFT);
menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
menu.attachToActivity(this, SlidingMenu.SLIDING_WINDOW);
menu.setMenu(R.layout.menu);
menu.setBehindWidthRes(200dp);
解决方案:
问题在此处说明https://github.com/jfeinstein10/SlidingMenu/issues/680(包括解决方案)。Slding Menu to SLIDING_CONTENT
OR: update the SlidingMenu source like mentioned in the link aboce
更好的解决方案: (对于5.0上的三星设备也适用)- 由withaay提供
Adding the following lines to the SlidingMenu constructors has worked for me. I didn't have to make any other code changes.
if(Build.VERSION.SDK_INT >= 21) setSystemUiVisibility(SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)