Android的LiveWallpaper:开始渲染以下通知栏 [英] Android LiveWallpaper: start rendering below notification bar

查看:315
本文介绍了Android的LiveWallpaper:开始渲染以下通知栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做与LibGDX一款Android LiveWallpaper,我想我的应用程序开始渲染通知栏的下方,而不是在它之下。
在图片:左是我得到的,我想要什么样的权利。任何建议?谢谢

I'm doing a Android LiveWallpaper with LibGDX and I want my application to start rendering below the notification bar, and not under it. In the picture: Left is what I get, right what I want. Any advice? Thanks

推荐答案

您可以使用此:的 Android的状态栏高度

和简单说下它借鉴。如果您使用的是基于图形(不Pixelbased),你可以使用这个Worldunit:

And simply draw under it. If you are using Worldunit based drawing (not Pixelbased) you can use this:

Gdx.gl.glViewport(x, statusbar.height, width, height);

要告诉你这是什么不看此链接:<一个href=\"http://blog.acamara.es/2012/02/05/keep-screen-aspect-ratio-with-different-resolutions-using-libgdx/\"相对=nofollow>保持纵横黑色边框

To show you what this does look at this link: Keep aspect with black borders

这篇关于Android的LiveWallpaper:开始渲染以下通知栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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