0

I have parentView rect of 1000x700 and i'm displaying the UIImageView in the rect of 350x199. But i need to displays the UIImageView aspect ratio of parentView.I referred here Resize UIImage with aspect ratio?. But how can i use this with my code

mmageView=[[UIImageView alloc]initWithFrame:CGRectMake(200,200,350,199)];

[self.view addSubview:mmageView];

Community
  • 1
  • 1
user3743552
  • 143
  • 3
  • 13
  • Are you saying that the image view should not exceed the dimensions of 350x199, but that it should bear the same aspect ratio of 1000x700? Also, what do you want to happen when the device is rotated? (Or is this landscape only?) Also, are you using auto layout or not? – Rob Jul 23 '14 at 04:54
  • 1
    @Rob: Thanks. I fixed my issue with ratio calculation – user3743552 Jul 23 '14 at 12:12
  • Great! You might want to either post your answer and accept it (see [Can I answer my own question?](http://stackoverflow.com/help/self-answer)), or just delete question altogether. Whichever you want, but we probably don't want to leave this question open like this. – Rob Jul 23 '14 at 13:44

0 Answers0