Cache view dimensions during initialization.