在Android的全屏模式下如何摆脱顶褪色的边缘? [英] How to get rid of top fading edge in android full screen mode?

查看:187
本文介绍了在Android的全屏模式下如何摆脱顶褪色的边缘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过将以下两行$​​ C $ c在activity.OnCreate,我可以得到一个全屏幕的看法:

By putting the following two lines of code in activity.OnCreate, I can get a full screen view:

requestWindowFeature(Window.FEATURE_NO_TITLE);         。getWindow()setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);

requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN );

但是,如果你仔细看,还有在它看起来像去掉标题栏的残留屏幕的顶部边缘有轻微的褪色边缘。我怎样才能摆脱那种完全?

However, if you look carefully, there is still a slight fading edge on the top edge of the screen which looks like a residue of the removed title bar. How can I get rid of that completely?

看到这个屏幕捕捉,这是一个使用上述两行的code获得全屏视图,但顶部衰落边缘是可见的,烦人的,我已经尝试过机器人:fadingEdge =none和机器人:fadingEdgeLength =在本次活动的根视图0SP,不工作:

See this screen capture, which is a fullscreen view obtained using the above two lines of code, but the top fading edge is visible and annoying, I already tried android:fadingEdge="none" and android:fadingEdgeLength="0sp" on the root view of this activity, doesn't work:

推荐答案

这将做你问什么:

requestWindowFeature(Window.FEATURE_NO_TITLE);
setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

这篇关于在Android的全屏模式下如何摆脱顶褪色的边缘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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