简体   繁体   中英

Set UIImageView with size 10x10 as background for UIView

I have image with size 10x10 px and I need to set the image as background for UIView with the image copied horizontally and vertical, not stretched. Is it possible to do with ios?

you can do it like this:

view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bodyBG"]];

It copied horizontally and vertical in default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM