Fix a layout bug when the app is resumed.