I am having trouble in getting UIView's height. I am trying to get the height and (x,y) of my UIView. The view is add as subview of Other view
float y = optionalView.frame.size.height;
NSLog(@"%.1f",y);
but it always return 0.0 . need guidance.
Thanks...
Have you tried this @Maulik?
CGFloat width = CGRectGetWidth(self.view.bounds);
CGFloat height = CGRectGetHeight(self.view.bounds);
However, if the class is UIView itself, then only:
CGFloat height = self.bounds.size.height
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With