Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/67.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
Ios 使用CGRect和CGContext为签名框创建ImageView_Ios_Objective C_Ios8_Cgcontext_Cgrect - Fatal编程技术网

Ios 使用CGRect和CGContext为签名框创建ImageView

Ios 使用CGRect和CGContext为签名框创建ImageView,ios,objective-c,ios8,cgcontext,cgrect,Ios,Objective C,Ios8,Cgcontext,Cgrect,我为我让用户用作签名框的应用程序创建图像视图。现在我正在使用下面的代码创建这个“盒子” 我想用下面的代码制作相同的矩形:基本上是一个有签名框的白色框(一个x和实线供人们签名) 如果我将代码替换为以下内容: imageframe = CGContextRef context = UIGraphicsGetCurrentContext(); CGContextConcatCTM(context, (CGAffineTransform){.a=1.0,.b=0.0,.c=0.0,.d=-1.0,

我为我让用户用作签名框的应用程序创建图像视图。现在我正在使用下面的代码创建这个“盒子”

我想用下面的代码制作相同的矩形:基本上是一个有签名框的白色框(一个x和实线供人们签名)

如果我将代码替换为以下内容:

imageframe =
CGContextRef context = UIGraphicsGetCurrentContext();  
 CGContextConcatCTM(context, (CGAffineTransform){.a=1.0,.b=0.0,.c=0.0,.d=-1.0,.tx=0.0,.ty=480.0,});
// rect_canvas_background 
 CGContextMoveToPoint(context,-1.0f,-1.0f);
 CGContextAddLineToPoint(context,641.0f,-1.0f);
 CGContextAddLineToPoint(context,641.0f,481.0f);
 CGContextAddLineToPoint(context,-1.0f,481.0f);
 CGContextClosePath(context);
 CGContextSetRGBFillColor(context,1.0f,1.0f,1.0f,1.0f);
 CGContextEOFillPath(context);

我得到了关于所有CGContext行的多个错误。我假设我在iOS中做这些事情的方式中遗漏了一些简单的东西,但我不知道它是什么。任何帮助都将不胜感激

就我而言

 CGContextConcatCTM(context, (CGAffineTransform){.a=1.0,.b=0.0,.c=0.0,.d=-1.0,.tx=0.0,.ty=480.0,});
包含以“.”开头的变量

尝试只传递值。我想不需要变量赋值


如果你成功了,那么也请告诉我。

有哪些错误?
 CGContextConcatCTM(context, (CGAffineTransform){.a=1.0,.b=0.0,.c=0.0,.d=-1.0,.tx=0.0,.ty=480.0,});