编程使Android应用程序全屏 [英] Programmatically make app FULL SCREEN in Android

查看:89
本文介绍了编程使Android应用程序全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,一个应用程序可以在活动的清单进行全屏按标签安卓主题=@安卓风格/ Theme.NoTitleBar.Fullscreen是否可以从应用程序中切换到全屏模式,编程?

I know that an app can be made full screen by tag in the manifest of the activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" Is it possible to switch to full screen mode from within the app, programmatically?

推荐答案

添加两行...

requestWindowFeature(Window.FEATURE_NO_TITLE); 
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);

这篇关于编程使Android应用程序全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆