【发布时间】:2012-12-03 18:12:54
【问题描述】:
您好,我之前问过这个问题,但没有得到任何解决方案。
运行 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>
【问题讨论】:
-
提供您的 xml 代码可能有助于识别问题。但是你可以尝试调用 view.invalidate() 来请求重新绘制整个视图。
-
stackoverflow.com/questions/13625070/… 已关闭,没有任何解决方案。
-
我有同样的问题,我正在启动一个仅横向的条形码扫描仪意图,当我回来时状态栏在顶部,我也将方向设置为纵向,你呢找到解决办法了吗?
标签: android android-layout android-activity statusbar android-camera-intent