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.
有没有办法使用 CoreGraphics 在矩形内重复 UIImage?这有点像http://www.raywenderlich.com/33496/core-graphics-tutorial-patterns,但我将使用从文件加载的图像。
使用图像作为图案颜色:
UIColor *color = [[UIColor alloc] initWithPatternImage:myImage]; someView.backgroundColor = color;
不过,不完全是 Core Graphics。如果你真的需要它,有CGColorCreateWithPattern. 需要设置更多代码。
CGColorCreateWithPattern