Update view size when device orientation changed

override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
    barView.frame = CGRect(x:0, y: 0, width: size.width, height: 30)
}

size is the container's size.

你可能感兴趣的:(Update view size when device orientation changed)