Android - ActionBar not resizing with onConfigurationChanged ( AppCompat )

前端 未结 3 1413
夕颜
夕颜 2020-12-11 17:31

In my application manifest I\'ve add android:configChanges to prevent activity reload/restart on rotate



        
3条回答
  •  伪装坚强ぢ
    2020-12-11 18:32

    By setting android:configChanges="orientation|keyboardHidden|screenSize"

    You declare that you will handle these config changes by yourself. In normal cases, you should not set that, and let Android recreate your Activity.

    Edit:

    If you want to keep the line android:configChanges, you have to override onConfigChanged() and change everything needed by yourself, e.g. the size of the ActionBar/ToolBar.

提交回复
热议问题