如何解决 ViewSonic gTablet 上状态栏覆盖全屏活动的问题?

发布于 2024-10-16 21:47:31 字数 768 浏览 14 评论 0原文

我正在尝试在 ViewSonic gTablet(Android 2.2) 上开发全屏应用程序。 该应用程序在模拟器上完美运行,但状态栏位于实际硬件上的应用程序上方(请参阅下面 URL 中的图片)。

http://i54.tinypic.com/1iy1r7.jpg

我已经尝试了两种隐藏状态的方法酒吧但无法解决它。

1)通过AndroidManifest.xm隐藏状态栏

`<activity android:name=".HelloAndroid"
          android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen">`

2)通过代码隐藏状态栏

`public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); //For fullscreen
}`

有人可以帮助我吗? 感谢您的评论。

问候,

I'm trying to develop a full screen application on ViewSonic gTablet(Android 2.2).
The application works perfectly on the emulator, but the status bar lays over the application on the actual hardware(Refer the picture from URL below).

http://i54.tinypic.com/1iy1r7.jpg

I have tried both ways to hide status bar but could not solve it.

1) Hide the Status bar through AndroidManifest.xm

`<activity android:name=".HelloAndroid"
          android:label="@string/app_name"
          android:theme="@android:style/Theme.NoTitleBar.Fullscreen">`

2) Hide the Status bar through code

`public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); //For fullscreen
}`

Could anyone help me?
Your comment is appreciated.

Regards,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城花音 2024-10-23 21:47:31

我可以自己解决。原因是应用程序的分辨率设置。
如果您遇到同样的问题,您应该在 AndroidManifest.xml 中添加一个元素,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application>...your setting...</application>
    <uses-sdk android:minSdkVersion="4"></uses-sdk> <!-- Add this element -->
</manifest>

问候,

I could solve it by myself. The reason was the application's resolution setting.
If you have a same issue, you should add an element into your AndroidManifest.xml as following:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application>...your setting...</application>
    <uses-sdk android:minSdkVersion="4"></uses-sdk> <!-- Add this element -->
</manifest>

Regards,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文