我想鞋在iPhone的视图两点在iphone的视角中,Y轴相反,如何调整它像Y轴数学?
这是我的代码
UIImageView *center;
center = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"point.png"]];
[center setFrame:CGRectMake(0, 0, 10, 10)];
float r_rect_center_x = [r_img frame].size.width/2;
float r_rect_center_y = [r_img frame].size.height/2;
[center setCenter:CGPointMake(r_rect_center_x,r_rect_center_y)];
[r_img addSubview:center];
[center release];
这是中心,我得到的结果中心点(X:50 Y:60)
float point1_x = 60.0f;
float point1_y = 60.0f;
UIImageView *point1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"point.png"]];
[point1 setFrame:CGRectMake(0, 0, 10, 10)];
[point1 setCenter:CGPointMake(point1_x,point1_y)];
[r_img addSubview:point1];
[point1 release];
这是点1,我设置了中心X:60 Y:60成
它应该是这个样子的
但在模拟器上运行的是这样的...
如何调整POINT1中心Y轴???
非常感谢
韦伯。
的可能重复[如何在上下文中绘制时翻转坐标?](http://stackoverflow.com/questions/1145595/how-to-flip-coordinates-when-drawing-in-context) –