Calculate height on every view switch.