How to make sure the UIView -drawRect: is drawing with contentScaleFactor of 1.0f?
-
29-09-2019 - |
Question
I've implemented -drawRect: to draw something, and I don't want that this drawing happens on a larger bitmap on the retina display. How can I make sure that this bitmap is always exactly the same across all devices?
I tried to set self.contentScaleFactor = 1.0f;
in the initialzier but that didn't help. The system seems to change this back to 2.0f automatically... In my NSLog I keep getting
contentScaleFactor = 2.0f
How to make sure it's 1.0f?
Solution
Probably a bit late, but if anyone needed...
-(void) layoutSubviews {
[super layoutSubviews];
self.contentScaleFactor = 1
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow