【问题标题】:Android - Landscape does not go back into the portraitAndroid - 横向不会回到纵向
【发布时间】:2016-10-28 18:36:38
【问题描述】:

我正在尝试为纵向和横向制作不同的布局。在 android 5.1+ 上一切正常,但在 android 5.0 上,当我开始纵向然后切换到横向并再次切换到纵向 - 垂直方向很好,但这里仍然是横向布局。

我只是在使用简单的东西:

layout
    content_main.xml
layout-land
    content_main.xml

关于 mainactivity 的 Manifest.xml

android:configChanges="locale|orientation"

layout-land/content_main.xml

android:orientation="horizontal"

布局/content_main.xml

android:orientation="vertical"

我还需要做什么?谢谢!

纵向(首次发布)- 好的

【问题讨论】:

  • 您是否在清单的活动标签中设置了方向?
  • 试试这个 android:configChanges="locale|orientation|screensize"
  • @DheerubhaiBansal 是的,我写的...
  • @Raman 有效!太好了,谢谢...你能写一个答案吗?

标签: android xml android-layout


【解决方案1】:

请试试这个 android:configChanges="locale|orientation|screensize"

这应该总是放在一起 android:configChanges="orientation|screensize"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-01
    • 1970-01-01
    相关资源
    最近更新 更多