简体   繁体   中英

Android -Fragment returns same layout on orientation change

当设备方向更改时,我有一个片段在不同文件夹(布局和layout-land)中具有相同名称的两个布局。片段显示总是在清单中显示为纵向布局,我具有活动android:configChanges =“ fontScale | screenSize | orientation的此属性|语言环境”

When you use android:configChanges="orientation|screenSize" in your manifest the activity is not recreated when device orientation changes and the layout continues the same.

If you want that onCreate to be called again on orientation change don't use those options in manifest.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM