[英]Y-axis opposite in iphone's view , how to adjust it like Y-axis mathematics?
我想在 iphone 的视野中穿两点
这是我的代码
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];
这是point1,我设置中心是X:60,Y:60
它应该看起来像这样
但是在模拟器上运行是这样的……
如何调整 Y 轴的 POINT1 中心???
非常感谢
韦伯。
视图上有一个 setFlipped: 方法。 只需调用它并通过YES
。
[view setFlipped:YES]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.