---
title: "How to display image without streach in UIScrollview?"  
description: "How to display image without streach in UIScrollview?"  
author: "Anonymous User"  
published: 2016-02-10  
updated: 2016-02-20  
canonical: https://www.mindstick.com/forum/33970/how-to-display-image-without-streach-in-uiscrollview  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# How to display image without streach in UIScrollview?

I have an [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) in our scrollview but the image is not displaying in its correct [dimension](https://www.mindstick.com/articles/1508/dimension-and-metrics-in-google-analytics-api-using-asp-dot-net-mvc) means displaying streatched image. So my [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is how can I prevent image being stretched in our UIScrollView controller.\
I [already](https://yourviews.mindstick.com/view/88453/the-hidden-ways-ai-is-already-controlling-your-daily-life) used AspectFill but it's not working.\
[Please suggest](https://answers.mindstick.com/qa/43506/please-suggest-the-bathing-date-at-kumbh) me how can I [solve this issue](https://answers.mindstick.com/qa/95726/i-am-getting-we-re-working-on-setting-you-up-on-my-google-adsense-for-a-very-long-time-how-should-i-solve-this-issue).\
Thanks.

## Replies

### Reply by Tarun Kumar

If you want to prevent your image being stretch in UIScrollView, then before adding the image view as subview of scrollview don't set the image view size according to the images size.I think you are setting your *UIImageView frame size* according to your *scrollview size* or *app view size*, if you are doing same as like I am thinking then don't do it.Use it like this:

```
UIImage *img = [UIImage imageNamed:@"img1.jpg"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:img];
[self.scrollview addSubview:self.imageView];
```

I think the above example is sufficient for you to understand the problem.


---

Original Source: https://www.mindstick.com/forum/33970/how-to-display-image-without-streach-in-uiscrollview

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
