1

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

我对运行 android 4.2 的 Galaxy nexus 有以下问题。

我正在使用相机意图拍照。如果我以横向模式捕获图片并返回到活动(活动android:screenOrientation="portrait"在清单中处于纵向模式),状态栏会隐藏视图。如果以纵向模式拍摄照片,效果很好。

这只发生在某些设备上,例如Galaxy Nexus Sony Xperia Neo 。我在设备上对其进行了测试,htc Desire Samsung 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>

4

2 回答 2

1

这是由于相机 api 在您启动相机应用程序时隐藏状态栏而发生的,并且由于某些问题状态栏绘制与布局重叠意味着状态栏区域覆盖了布局。您可以通过隐藏和显示状态栏来解决此问题。标题栏没有问题。在此处查看我的解决方案:Android:Layout move up & about 20dp area from the top hides behind the status bar

于 2013-04-03T16:31:04.353 回答
0

你可以这样做

 setTitle(""); leaves the title blank. 

setDisplayShowTitleEnabled(false); also just leaves the title blank. 
于 2012-12-03T18:20:04.807 回答