I created a subclass of UIView and within the subclass I try to access the views’ width property. I try to get the width like this,
CGFloat width = self.frame.size.width;
NSLog(@"Width: %f", width);
However for some reason the width I’m getting is equal to 0.000000
When I create the view I’m setting the frame property using the CGRectMake() function and the view is clearly displaying properly so why would the width property return zero?
If you subclass UIPickerView, irrespective of the frame you set, width and height are 320,216 (for Portrait).
Make sure
selfin your code points to the picker.