layout-land xml files does not work with onConfigurationChanged call back

后端 未结 2 1882
一生所求
一生所求 2021-01-21 09:36

I have different layouts for portrait and landscape mode and I also need to override the onConfigurationChanged() callback. But problem is when I change the phone

2条回答
  •  佛祖请我去吃肉
    2021-01-21 10:13

    i also need to override the onConfigurationChanged() callback

    Why?

    but problem is when i change the phone orientation to landscape my landscape layout does not work.

    I am going to guess that "does not work" means that the landscape layout does not take effect. This is expected behavior given what you have done.

    To resolve this problem, ideally you delete android:configChanges="keyboardHidden|orientation". Putting in that attribute should be done as a last resort, and typically for activities that do not have separate portrait versus landscape layout files.

提交回复
热议问题