Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/21.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
Objective c 如何更改UIImageView的坐标?_Objective C_Interface Builder_Uiimageview_Coordinates - Fatal编程技术网

Objective c 如何更改UIImageView的坐标?

Objective c 如何更改UIImageView的坐标?,objective-c,interface-builder,uiimageview,coordinates,Objective C,Interface Builder,Uiimageview,Coordinates,我在Interface Builder中制作了一个UIImageView显示我选择的图像 在代码中,我想找到一种方法,在程序中更改此图像视图的x和y坐标 有可能吗 我已经做了一个变量 IBOutlet UIImageView *Alan; 但是我不确定该怎么处理它。更改视图的帧属性: Alan.frame = (CGRect){{newX, newY}, Alan.frame.size}; // same as // Alan.frame = CGRectMake(newX, newY, A

我在Interface Builder中制作了一个
UIImageView
显示我选择的图像

在代码中,我想找到一种方法,在程序中更改此图像视图的x和y坐标

有可能吗

我已经做了一个变量

IBOutlet UIImageView *Alan;

但是我不确定该怎么处理它。

更改视图的
帧属性:

Alan.frame = (CGRect){{newX, newY}, Alan.frame.size};
// same as 
// Alan.frame = CGRectMake(newX, newY, Alan.frame.size.width, Alan.frame.size.height);
或者,如果要设置视图中心的位置:

Alan.center = CGPointMake(newX, newY);

p.S.请注意,根据objective-c命名指南,实例变量名称应以小写字母开头。

更改视图的
框架属性:

Alan.frame = (CGRect){{newX, newY}, Alan.frame.size};
// same as 
// Alan.frame = CGRectMake(newX, newY, Alan.frame.size.width, Alan.frame.size.height);
或者,如果要设置视图中心的位置:

Alan.center = CGPointMake(newX, newY);
另请注意,根据objective-c命名指南,实例变量名称应以小写字母开头