編輯使用的WebView和RelativeLayout的時候: 這裏的顯示問題視頻:www.youtube.com/watch?v=5ZZsuMH5T9k我真的被困在這裏:/奇怪的行爲在全屏
-
我有它由一個活動一個webview和一個按鈕在底部。我設置了活動的窗口onCreate
使用此代碼切換到全屏模式:
@Override
public void onCreate(Bundle savedInstanceState) {
InstaFetchApplication.applyCurrentTheme(this);
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
requestWindowFeature(Window.FEATURE_PROGRESS);
if (UserPreferences.getIsFullScreenReadingEnabled(this)) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
// this just do this: window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
ActivityUtils.toggleFullScreen(this, true);
}
setContentView(R.layout.view_article);
// ...
}
的問題是,大部分時間 web視圖似乎「推」按鈕關閉屏幕。下面是截圖:
我希望看到(和有時我)在這裏:
這裏是
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_test"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:text="Click me!"
/>
<WebView
android:id="@+id/web_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/button"
/>
</RelativeLayout>
我也注意到,如果你使用的系統設置中關閉所有的動畫在設備上,這個問題就沒了(:我使用的(請注意,我的應用程序上的佈局已經是一個RelativeLayout的)佈局雖然當整個視圖有一個頂部邊距然後它跳回到正確的位置時會出現這個故障)。
有沒有人遇到類似的問題,並知道如何解決它?
你可以發佈'onCreate()' – 2011-12-21 05:22:18
你正在測試設備或模擬器? – 2011-12-21 06:49:49
你可以發佈你的代碼嗎?標題欄中是否需要進度對話框? 'Window.FEATURE_PROGRESS'應該和'setProgressBarVisibility(true)'一起使用,或者如果你不想使用進度條,就不要使用它。如果你想隱藏標題欄,那麼你可以使用'android:windowNoTitle' – 2011-12-21 17:22:44