0
我正在使用一个xib文件来处理我的旧项目。我有一个按钮,将UIImageview
的位置更改为0,0,但它不起作用,标签停留在初始位置。当我用完全相同的代码创建新项目时,它包含一个mainStoryboard.Storyboard,它工作正常。我想这与xib文件和文件所有者有关。为什么我无法访问UIImageview.center?
#import "ViewController.h"
@interface ViewController()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)Action1:(id)sender {
imageview.center = CGPointMake(0, 0);
}
你说'UIImageView'的中心,但我只看到一个'UILabel'的中心被称为...? – JMarsh
label1是imageView?正如@JMarsh已经问过,UIImageView在哪里?请发布适当的问题。 – Pawan
对不起,我编辑它。我发布了错误的代码,但它仍然与标签和所有其他UI元素相同。 ;) – Freddy