Questions tagged [contentmode]

iOS SDK property of UIView: used to determine how a view lays out its content when its bounds change.

74 questions
0
votes
0 answers

There is no effect on the image's display mode when I set the imageView's property contentMode as UIViewContentModeScaleAspectFit

As the above description, when I set the imageView's property contentMode as UIViewContentModeScaleAspectFit or UIViewContentModeScaleAspectFill, the image on it displays like that the contenMode is setted as UIViewContentModeScaleToFill.
0
votes
2 answers

image doesn't fit in UIImageView

I am a beginner in iOS development and stuck at the following problem. In .xib file I have button and imageview as displayed in following image. Now I did the following to show image in image view and set content mode in .m file. UIImage *save =…
dakshbhatt21
  • 3,558
  • 3
  • 31
  • 40
0
votes
2 answers

When/How to set UIImageView contentMode (UIImageView setContentMode not working)

I cannot figure out why the UIImages in my UIImageViews are not properly resizing to the size of the UIImageView. Can anyone shed some light on the problem in my code? The follow is the relevant code from my SidewalkPlusSuperCell, which is a…
phil4
  • 45
  • 1
  • 7
0
votes
1 answer

Show a Specific Part of an Image

Let's say I have an UIImageView which is significantly smaller than the image it's showing. I set contentMode to UIViewContentModeScaleAspectFill to make it look like you're seeing only a specific part of the image. It automatically shows the center…
user1563544
  • 379
  • 3
  • 17
0
votes
1 answer

UIImageView contentMode Top

I've got an image that I need crop. To do this, I wanted to use the contentMode (set it to Top/TopLeft instead of Aspect Fit) but when I'm doing this, the image go back to it's real size (and not the size I gave to it). So my question is : How to…
Aeradriel
  • 1,224
  • 14
  • 36
0
votes
1 answer

iOS >> UITableViewCell ImageView Property >> ContentMode doesn't have any effect

In many cases using one of the 4 UITableViewCell 'of the shelf' styles is enough for what I need, except for one 'little' annoying thing: The cell.imageView.contentMode property is always set to Scale to Fill. If images have different ratios, it…
Ohad Regev
  • 5,641
  • 12
  • 60
  • 84
0
votes
3 answers

Resize content of UIImage

Please check the attached images in order to understand the issue in brief. Please note the size of the X character and the circle character . The images for both the characters are equal in size , but due to the shape of the second character it…
Singh
  • 2,151
  • 3
  • 15
  • 30
0
votes
1 answer

iOS UIScrollView size child view only once

I have an image as a subview of a UIScrollView. I want the image to initially fit the screen's bounds using autoResizingMask and contentMode (UIViewContentModeAspectFit) property of UIView. When the scrollview's frame is changed to make room for the…
user26691
  • 77
  • 5
0
votes
1 answer

Printing captured screenshot - blurred image

I've got some code to print screenshot. The problem is that instead of 'fit' image, default action is to 'fill' paper with image, what causes stretches. In case of printing screen of iphone (eg non-retina) it is looking awful. I can't find property…
Nat
  • 12,032
  • 9
  • 56
  • 103
0
votes
1 answer

How to make border image to be fitted as per aspectfit uiimageview size?

In my application i have 2 uiimageview.one imageview contains the image that user selects either from photo library or take picture from camera.contentmode of this imageview is aspectfit so that image is not stretched if it is of lesser size.There…
iosdev1111
  • 1,048
  • 1
  • 13
  • 32
0
votes
2 answers

imageView in UITableView cell violates setClipsToBounds on touchdown event

I have a UITableView whose cells have an image from a URL placed in its imageView. The image isn't square (is landscape), however it initially loads as a square in the manner in which contentMode is scaleAspectFill and setClipsToBounds is YES. So…
Steven
  • 1,049
  • 2
  • 14
  • 32
0
votes
2 answers

Scale UIImageView after orientation changed

In my application i have UIIMageView within UIView, in portrait mode imageview fills whole area of UIView, but after orientation is changed UIView rotates but not stretched, though i have set content mode of UIView to Scale to fill, what is wrong?
taffarel
  • 4,015
  • 4
  • 33
  • 61
-1
votes
2 answers

UITableView contentMode not working

I have a UITableView and I set its contentMode to bottom. I expected when the orientation changes, the bottom part of the UITableView will stay foot and the top part will change. Yet this doesn't happen. I printed the content mode on the willRotate…
Nimrod Shai
  • 1,149
  • 13
  • 26
-1
votes
1 answer

drawrect to fit uiview no matter the size

I have a uiview class that calls a custom drawing class method with a drawrect in it. The drawrect drawing coordinates are drawn for a 433x439 uiview. When this app opens on an iPad Pro autolayout changes the size of the uiview (correctly). But the…
malaki1974
  • 1,605
  • 3
  • 16
  • 32
1 2 3 4
5