English 中文(简体)
现况:Bar重叠与工具栏,工具栏则转载于Ant30+。
原标题:StatusBar overlaps app s toolbar and the toolbar is gone on Android API 30+

我在安伯斯30+上有一个灯泡问题。 该装置的地位障碍与我的手法相重叠,工具障碍已经消失。 这一问题没有出现在低于30个(29、28、27、......)的仪器上。 我通过Stackoverflow查询,没有找到任何办法解决我的案件。

我尝试了getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);,它使工具障碍重,以完全筛选方式显示仪器,但装置状态障碍和底线重叠(半透明)的仪器内容。

我想的是,这些装置的状态条形,底线的航行条形与仪器的内容并不重叠。 它们可能出现或消失。

active_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawerLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <!-- Main content -->
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <!-- Toolbar -->
        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar_main"/>

        <FrameLayout
            android:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@id/toolbar" />

        <!-- Loading box -->
        <RelativeLayout
            android:id="@+id/boxProgress"
            android:layout_width="@dimen/loading_box_size"
            android:layout_height="@dimen/loading_box_size"
            android:layout_centerInParent="true"
            android:layout_gravity="center"
            android:visibility="gone">

            <FrameLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_centerInParent="true"
                android:alpha="0.8"
                android:background="@drawable/background_round_corner" />

            <ProgressBar
                android:id="@+id/progressBar"
                style="?android:attr/progressBarStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_margin="@dimen/box_margin_medium"
                android:indeterminate="true" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/progressBar"
                android:layout_centerHorizontal="true"
                android:text="@string/label_status_loading"
                android:textSize="@dimen/text_size_medium" />

        </RelativeLayout>
    </RelativeLayout>

    <!-- Order drawer (slide from right) -->
    <FrameLayout
        android:id="@+id/drawer"
        android:layout_width="@dimen/drawer_width"
        android:layout_height="match_parent"
        android:layout_gravity="end" />

</androidx.drawerlayout.widget.DrawerLayout>

toolbar_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="36dp"
    android:contentInsetEnd="0dp"
    android:contentInsetLeft="0dp"
    android:contentInsetRight="0dp"
    android:contentInsetStart="0dp"
    android:contentInsetStartWithNavigation="0dp"
    android:fitsSystemWindows="true"
    android:minHeight="36dp"
    android:theme="@style/ToolbarStyle"
    android:layout_marginBottom="@dimen/box_margin_bottom_small"
    app:contentInsetEnd="0dp"
    app:contentInsetLeft="0dp"
    app:contentInsetRight="0dp"
    app:contentInsetStart="0dp"
    app:contentInsetStartWithNavigation="0dp"
    app:popupTheme="@style/AppTheme.PopupOverlay">

    <ImageView
        android:id="@+id/toolbarIndicator"
        android:layout_width="36dp"
        android:layout_height="36dp"
        android:scaleType="centerInside"
        android:padding="@dimen/box_padding_small"/>

    <FrameLayout
        android:id="@+id/toolbarContainer"
        android:layout_width="match_parent"
        android:layout_height="36dp" />

</androidx.appcompat.widget.Toolbar>

<<>Application Theme

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">...</style>
最佳回答

我最后想起它的作用! 过去,我曾用以下代码在MainActative.kt上添加onCreate(>

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
   this.window.setDecorFitsSystemWindows(false)
}

在我去除之后,所有东西都回头去了。 感谢C.F.G,请让我介绍<>fitSystemvil/code> 财产。

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签