-->

的Android - 状态栏隐藏的视图部分有时(Android - Status bar hide

2019-10-17 11:35发布

你好我以前问过这个问题,但没有得到任何解决方案。

我有以下与Galaxy Nexus的运行Android 4.2的问题。

我使用的相机意图拍照。 如果我在拍摄风景模式PIC,并返回到活动(活动与纵向模式android:screenOrientation="portrait"清单中)状态栏隐藏视图。 它运作良好,如果PIC是采取纵向模式。

这只发生与像某些设备Galaxy NexusSony Xperia Neo 。 我测试htc DesireSamsung Ace设备效果很好。

请帮忙。

查看后面的状态栏

而需要

编辑:布局XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/signup_bg"
android:orientation="vertical" >
<include
    android:layout_width="match_parent"
    android:layout_height="@dimen/abs__action_bar_default_height"
    layout="@layout/titlebar_account" />
<ScrollView
    android:id="@+id/editAccountScrollView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >
    <LinearLayout
        android:id="@+id/editAccountLinearLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >
        <include
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="16dp"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:layout_marginTop="16dp"
            layout="@layout/signup_basic" />
        <include
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            layout="@layout/signup_home_base" />
        <TextView
            android:id="@+id/textView1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:paddingBottom="12dp"
            android:paddingLeft="16dp"
            android:paddingRight="16dp"
            android:paddingTop="10dp"
            android:text="@string/account_about_me"
            android:textColor="@color/account_headings" />
        <include
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            layout="@layout/edit_account_email_about_me" />
        <include
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            layout="@layout/edit_account_social" />
    </LinearLayout>
</ScrollView>

Answer 1:

当您启动相机应用它隐藏状态栏以及由于一些问题,状态栏绘制重叠的布局意味着状态栏区域覆盖布局这是发生由于照相机API。 您可以通过隐藏和显示状态栏解决这个问题。 有什么不对的标题栏。 点击这里给我的解决方案: 安卓布局约20dp面积从状态栏后面顶皮向上移动&



Answer 2:

你可以做到这一点通过

 setTitle(""); leaves the title blank. 

setDisplayShowTitleEnabled(false); also just leaves the title blank. 


文章来源: Android - Status bar hides part of view sometimes