是否可以永久刪除活動上的導航欄?我想使用出現在平板電腦屏幕按鈕上的按鈕而不是操作欄來刪除該欄。在這里。我知道不建議您這樣做,我沒有做出此決定,但我需要這樣做。在我的布局上,還有另一個按鈕可以退出活動。我的應用程序的其余部分可以具有導航欄。我找到了這段代碼,并對其進行了一些修改。問題是,即使我隱藏了導航欄,也仍然留有黑色空間。我想系統會在考慮導航欄的情況下計算屏幕尺寸?public static class Content extends ImageView implements View.OnSystemUiVisibilityChangeListener, View.OnClickListener, ActionBar.OnMenuVisibilityListener { Activity mActivity; TextView mTitleView; Button mPlayButton; SeekBar mSeekView; boolean mAddedMenuListener; boolean mMenusOpen; boolean mPaused; boolean mNavVisible; int mLastSystemUiVis; Runnable mNavHider = new Runnable() { @Override public void run() { setNavVisibility(false); } }; public Content(Context context, AttributeSet attrs) { super(context, attrs); setOnSystemUiVisibilityChangeListener(this); setOnClickListener(this); } public void init(Activity activity, TextView title, Button playButton, SeekBar seek) { // This called by the containing activity to supply the surrounding // state of the video player that it will interact with. mActivity = activity; mTitleView = title; mPlayButton = playButton; mSeekView = seek; mPlayButton.setOnClickListener(this); setPlayPaused(true); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); if (mActivity != null) { mAddedMenuListener = true; mActivity.getActionBar().addOnMenuVisibilityListener(this); } } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); if (mAddedMenuListener) { mActivity.getActionBar().removeOnMenuVisibilityListener(this); } }
- 3 回答
- 0 關注
- 286 瀏覽
添加回答
舉報
0/150
提交
取消