UIImageview以编程方式更改位置

UIImageview以编程方式更改位置,uiimageview,uitextfield,Uiimageview,Uitextfield,我创建了一个iPhone问答应用程序,其中有些问题有图像,有些问题没有图像。为此,我使用UItextfield显示问题,使用UIImageView显示问题图像。但当出现“无图像问题”时,问题显示在xib的上方,选项显示在xib的下方,这不好。我想更改图像视图和文本字段的位置,以对应问题图像。如何更改uicontrol的位置?。请帮帮我。感谢高级版。这是重新定位/调整UIView大小的方法 CGRect frame = myControl.frame; frame.origin.x = newX;

我创建了一个iPhone问答应用程序,其中有些问题有图像,有些问题没有图像。为此,我使用
UItextfield
显示问题,使用
UIImageView
显示问题图像。但当出现“无图像问题”时,问题显示在xib的上方,选项显示在xib的下方,这不好。我想更改图像视图和文本字段的位置,以对应问题图像。如何更改uicontrol的位置?。请帮帮我。感谢高级版。

这是重新定位/调整UIView大小的方法

CGRect frame = myControl.frame;
frame.origin.x = newX;
frame.origin.y = newY;
frame.size.width = newWidth;
frame.size.height = newHeight;
myControl.frame = frame; 

这就是如何重新定位/调整UIView的大小

CGRect frame = myControl.frame;
frame.origin.x = newX;
frame.origin.y = newY;
frame.size.width = newWidth;
frame.size.height = newHeight;
myControl.frame = frame;