Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Is it possible to show a UIImage in a UIImageView such that the image is both, scaled and tiled?
for example, it should be scaled at 2 times it's actual resolution, but tiled across the full size of the UIImageView.
Is this doable?
这应该工作:
UIImage *image = [UIImage imageNamed:@"tile"]; UIImage *newImage = [UIImage imageWithCGImage:[image CGImage] scale:0.5 orientation:image.imageOrientation]; [self.myImageView setBackgroundColor:[UIColor colorWithPatternImage:newImage]];