我有一个简单的Android应用程序,目标Android 1.5或以上。我有一个活动被设置为使用下面的主题(在清单中设置)。全屏活动w/Webview仍然显示状态栏顶部
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
在活动中,我有一个web视图(请参阅完整的XML :)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
我相信我有我的onCreate
代码设置,妥善处理urlLoading(见下文)。在模拟器中,当我测试这个代码时,状态栏不会显示在顶部。在我的目标设备上运行的是一款运行Android 1.5并且屏幕分辨率为800 x 480的爱可视7家用平板电脑,该应用程序运行,但状态栏显示在顶部。
任何想法,为什么这可能会发生?
主要活动的完整来源:
package com.bri.RestaurantLauncher;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.WebView;
import android.webkit.WebViewClient;
public class RestaurantLauncherMain extends Activity {
private class RestaurantLauncherMainWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
}
WebView webview;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
this.webview = (WebView) findViewById(R.id.webview);
webview.setWebViewClient(new RestaurantLauncherMainWebViewClient());
this.webview.getSettings().setJavaScriptEnabled(true);
this.webview.loadUrl("http://www.google.com");
}
}
对您的问题的可能答案:http://stackoverflow.com/a/4483904/436938 – 2011-12-01 06:42:38