0

如果我没有连接到文本字段,那么 UIImageView 的调整大小就可以了。如果我写入文本区域,则调整大小失败。我不知道为什么写入文本会对 UIImageView 的调整大小产生不利影响。

@interface rjhccViewController ()

@end

@implementation rjhccViewController

-(IBAction)myButtonPress{

UIImage *img = [UIImage imageNamed:@"p.png"];
[testcontainer setImage:img];
[testcontainer setFrame:CGRectMake(0.0,0.0,50.0, 50.0)];
[self labelHeight:img];
}

-(void)labelHeight: (UIImage *) myimage{
//self.heightS.text = [NSString stringWithFormat:@"%d",(int)myimage.size.height];

}


- (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.
}

- (void)viewDidUnload {
[self setHeightS:nil];

[super viewDidUnload];
}
@end
4

0 回答 0