Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Xcode中使用colorWithPatternImage?_Image_Xcode4_Design Patterns_Draw - Fatal编程技术网

如何在Xcode中使用colorWithPatternImage?

如何在Xcode中使用colorWithPatternImage?,image,xcode4,design-patterns,draw,Image,Xcode4,Design Patterns,Draw,我有以下代码: brushColor = [UIColor greenColor]; 为了插入“绿色”,我想插入一个图案图像,如: brushColor = [UIColor colorWithPatternImage(UIImage *)]; 在“(UIImage*)”部分,我插入了[UIImage imagename:@“myimage.png”] 当我构建并运行我的应用程序时,我的画笔没有任何颜色和alpha。 我能做什么?我在哪里犯了错误?我的视图有这样的设置,可以正常工作: myV

我有以下代码:

brushColor = [UIColor greenColor];
为了插入“绿色”,我想插入一个图案图像,如:

brushColor = [UIColor colorWithPatternImage(UIImage *)];
在“
(UIImage*)
”部分,我插入了
[UIImage imagename:@“myimage.png”]

当我构建并运行我的应用程序时,我的画笔没有任何颜色和alpha。
我能做什么?我在哪里犯了错误?

我的视图有这样的设置,可以正常工作:

myView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"myBackgroundImage.png"]];