No menu background color on device rotation
- Expected behavior and actual behavior.
Actual behavior

Expected behavior: The whole menu view to be blue color as well, so no white space while rotating the device.
- Steps to reproduce the problem.
The first I've done a small configuration:
Configuration
private struct PagingMenuOptions: PagingMenuControllerCustomizable {
private var componentType: ComponentType {
return .All(menuOptions: MenuOptions(), pagingControllers: pagingControllers)
}
private var pagingControllers: [UIViewController] {
return [SignInViewController(), SignUpViewController()]
}
}
private struct MenuOptions: MenuViewCustomizable {
var displayMode: MenuDisplayMode {
return .SegmentedControl
}
private var height: CGFloat {
return ez.screenOrientation.isPortrait ? 90.0 : 64.0
}
private var backgroundColor: UIColor {
return UIColor(r: 16, g: 66, b: 101)
}
private var selectedBackgroundColor: UIColor {
return UIColor(r: 16, g: 66, b: 101)
}
private var focusMode: MenuFocusMode {
return .Underline(height: 4.0,
color: UIColor(r: 229, g: 238, b: 245),
horizontalPadding: 0,
verticalPadding: 0)
}
var itemsOptions: [MenuItemViewCustomizable] {
return [SignInMenuItem(), SignUpMenuItem()]
}
private struct SignInMenuItem: MenuItemViewCustomizable {
var displayMode: MenuItemDisplayMode {
return .Text(title: MenuItemText(text: "Sign In",
color: UIColor(white: 1.0, alpha: 0.52),
selectedColor: UIColor.whiteColor()))
}
}
private struct SignUpMenuItem: MenuItemViewCustomizable {
var displayMode: MenuItemDisplayMode {
return .Text(title: MenuItemText(text: "Sign Up",
color: UIColor(white: 1.0, alpha: 0.52),
selectedColor: UIColor.whiteColor()))
}
}
}
Then in viewDidLoad I added setup of paging menu:
navigationController?.navigationBarHidden = true
pagingMenuController = PagingMenuController(options: PagingMenuOptions())
addChildViewController(pagingMenuController)
view.addSubview(pagingMenuController.view)
pagingMenuController.didMoveToParentViewController(self)
Also I added rotate notification, thus I need different height for portrait and landscape. When orientation changes I call setup again:
pagingMenuController.setup(PagingMenuOptions())
This PagingMenuOptions are stick to orientation mode:
private var height: CGFloat {
return ez.screenOrientation.isPortrait ? 90.0 : 64.0
}
But when rotating the device, there is white space, if I'm going from landscape to portrait one.
- Specifications like the version of the project, library, or Swift.
PagingMenuController (1.1.2), Swift 2.3
Changing options value is not supported yet which might cause this issue. I'm working on it now.
pagingMenuController.setup(options) method should be called explicitly if you want to change option value for now.