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
2 answers

Large UIImage not scaling down into Scroll View's frame

i can't seem to use UIViewContentModeScaleAspectFit property to scale my imageView within my scrollview to fit the scrollview size. - (void)loadView { UIImage* image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL…
Ben Kong
  • 35
  • 1
  • 6
0
votes
1 answer

ContentMode scaleAspectToFit doesn't work

I have 3 views. 1. It's the main view and it contains the other two views. 2. It's a view that is bigger than the first. 3. It's is contained by the second view. I want to resize the second (and obviously the third) to the size of the first view…
radon90
  • 23
  • 3
  • 6
0
votes
1 answer

Set contentMode for Image inside Button in Swift

I am trying to setImage inside my UIButton but the image appears smaller inside the button although there is "free-space" and I also set the contentMode. Button: let noteButton: UIButton = { let v = UIButton() v.setImage(UIImage(systemName:…
Chris
  • 1,828
  • 6
  • 40
  • 108
0
votes
1 answer

Vector images in UIImageView are rendered differently in iOS 12 and 13

I'm using some pdf images in my xcassets with "preserve vector data" checked. The same image is rendered differently across different iOS versions (I'm using Xcode 11.2). On the left, the image is rendered as expected in iOS 13.2, on the right the…
Totka
  • 627
  • 6
  • 24
0
votes
5 answers

UIButton ImageView contentmode doesn't work

I just started an app for iOS in Swift, I'm doing the design programmatically (I mean I'm not using storyboard) I have a UIButton with an image inside, I would like the image to fill the entire button. Right now it just show the image in my button,…
Quentin Rth
  • 178
  • 1
  • 15
0
votes
1 answer

Setting Content Mode of UIButton Images

I am developing an application in swift. I have 9 buttons in my storyboard and i set the content mode of the button images in viewDidLoad() function. But it takes a few seconds to set content modes, so my page is opening a little late. Is there any…
nihasmata
  • 652
  • 1
  • 8
  • 28
0
votes
1 answer

How to change uiimageview content mode at runtime?

I have a UIViewController with an UIImageView, if I tap the screen, i want the UIImageView to change its contentMode. But I found out that this is not working with some images, mainly those from AVCaptureSession. Screenshots: Aspect fill Aspect…
esyx
  • 31
  • 6
0
votes
1 answer

why the contentmode of the uiimageview did not work?

yesterday when i code I am puzzled by a question about contentMode of UIImageView.I want to set UIViewContentModeScaleAspectFill to the UIImageView but the effect of that the image overflow the UIImageView,this is the result:![enter image…
James
  • 23
  • 5
0
votes
2 answers

Can't fully scroll within UIScrollView

I have a UIImageView within a UIScrollView, and I want to be able to scroll around the dimensions of the "regular" photo dimensions. My issue is that I am able to scroll, however when it gets to the top or towards the bottom of the photo, the scroll…
AndrewS
  • 351
  • 4
  • 18
0
votes
0 answers

How to set up image view so that image fill the whole size and doesn't stretch in Swift?

I want to show 4 imageViews on my screen. The images should always fill the whole image view area. The problem is, that I don't know how to fix that without stretching the photo. I've tried nearly everything but nothing really seems to work. Even if…
JoeAllenWelsh
  • 51
  • 1
  • 5
0
votes
1 answer

Why is UIImageView.content mode ignored

I have a vertical UIStackView with three subviews and I want to center the content in all three of these subviews. I'm doing this all programmatically, not with the storyboard. I started by trying to use the storyboard and only adding the last…
Jim
  • 1,260
  • 15
  • 37
0
votes
1 answer

UIImageView scaling image issue

I have a UIImage with its width much greater than its height. I'm trying to display it in a UIImageView while keeping the aspect ratio, but the imageview only displays a small part of the image. Am I doing something wrong? func scale(image:UIImage)…
mawnch
  • 385
  • 2
  • 4
  • 13
0
votes
1 answer

Who change the image's size? SDWebImage or ContentMode

I use SDWebImage to set image like this: [self.imageView sd_setImageWithURL:topicModel.large_image] placeholderImage:nil options:0 progress:^(NSInteger receivedSize, NSInteger expectedSize) { } completed:^(UIImage…
SketchK
  • 411
  • 4
  • 11
0
votes
1 answer

Change UIImage, content mode make image detail

I've got UITableViewCell with an image in it. The image I'd like to show is stretched so I would like to show the image more in detail. First of all I'd like change the image in such a way the bottle is in detail. So the other thins around can or…
0
votes
0 answers

Maintain image quality in iOS Application

I am trying to create a photo application but I am having a tough time formatting my photos so that they show clearly. I have an imageview size 320 * 500, and an image size 3648*2736 px (Which of course I can scale down). …
Niana
  • 1,057
  • 2
  • 14
  • 42