Fix handling of orientation changes in views with dynamic layouts.