我想在 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 中心?
非常感谢
韦伯。