为了账号安全,请及时绑定邮箱和手机立即绑定

永久隐藏活动中的导航栏

永久隐藏活动中的导航栏

大话西游666 2019-10-18 13:50:02
是否可以永久删除活动上的导航栏?我想使用出现在平板电脑屏幕按钮上的按钮而不是操作栏来删除该栏。在这里。我知道不建议您这样做,我没有做出此决定,但我需要这样做。在我的布局上,还有另一个按钮可以退出活动。我的应用程序的其余部分可以具有导航栏。我找到了这段代码,并对其进行了一些修改。问题是,即使我隐藏了导航栏,也仍然留有黑色空间。我想系统会在考虑导航栏的情况下计算屏幕尺寸?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 回答

?
函数式编程

TA贡献1807条经验 获得超9个赞

AFAIK,如果没有root用户访问权限,这是不可能的。能够拥有无法通过系统按钮退出的应用程序将是一个安全问题。

查看完整回答
反对 回复 2019-10-18
  • 3 回答
  • 0 关注
  • 267 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信