Questions tagged [contentmode]

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

74 questions
1
vote
0 answers

How to set multiple options for contentMode in UIImageView in Swift

What is the best way, if you need a combination of contentModes in UIImageView? Example: .scaleToFill + .top
SchmidtFx
  • 498
  • 4
  • 16
1
vote
2 answers

Setting content mode in UIImageView no longer works in iOS 11

I have this code in order to put an UIImageView in the center of a navigation controller bar and properly scale the image: override func viewDidAppear(_ animated: Bool) { let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 150, height:…
Andrea Gorrieri
  • 1,704
  • 2
  • 22
  • 36
1
vote
2 answers

How to implement contentMode for GLKView displaying a CIImage?

I have make a GLKView subclass to display CIImage for better performance displaying the output image for a chain of CIFilters. However, it seem that I need to implement to contentMode logic in order to have a correct inRect for drawImage(image:…
Morty Choi
  • 2,466
  • 1
  • 18
  • 26
1
vote
1 answer

IOS UIImageView in cell has wrong size

I'm trying to replace an Image from an URL if it exists. The problem seems to be that I can't set the size of my UIImageView. My Code looks like this: UIImageView *partnerIcon = (UIImageView*)[cell viewWithTag:0]; NSURL *imageUrl = [NSURL…
fsulser
  • 853
  • 2
  • 10
  • 34
1
vote
2 answers

UIImage not setting as AspectFill - iOS

I'm using an expandable TableView, (HVTableView), and in it I'm setting some images, which are downloaded from URLs. Problem is the images are not setting as AspectFill even though I've set everything in Storyboard as well as…
Hyder
  • 1,163
  • 2
  • 13
  • 37
1
vote
2 answers

Fit FULL image in 612x612 size for Instagram while keeping ratio

I want to be able to fit any FULL image in a 612x612 UIImage for Instagram integration in my app. But i don't want any of the sides cut or anything. I want the full image weather its in landscape or portrait to fit fully in a 612x612 image. What im…
4GetFullOf
  • 1,738
  • 4
  • 22
  • 47
1
vote
2 answers

UIImageView Aspect Ratio?

I have an image of size 320X460 and I want to create an UIImageView which height should be 450. To maintain aspect ratio I calculated the width of UIImageView = (320/460)*450 = 313.043 dynamically. And set the contentMode For UIImageView is…
jailani
  • 2,260
  • 2
  • 21
  • 45
1
vote
1 answer

iOS: Scale up image in UIButton

I'm setting an image to a UIButton like this: [fView.coverImage.imageView setImageWithURLRequest:[NSURLRequest requestWithURL:MYURL] placeholderImage:nil success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) { …
James Harpe
  • 4,315
  • 8
  • 47
  • 74
1
vote
2 answers

Creating UIImageView in Custom Cell leaves Artifacts from old image when using ScaleAspectFit

I have a table with a CustomCell, when drawing the cell I create a UIImageView and add it as a Subview to a scrolView. The image also has it's contentMode set to UIViewContentModeScaleAspectFit. The problem is when the next Cell is drawn if the…
Recycled Steel
  • 2,272
  • 3
  • 30
  • 35
1
vote
1 answer

How do I autoresize an image, but at the top of the ImageView (programmatically in Xcode)?

I have an imageView (say 100x100) that I want to fill with a (smaller) image (say 50x10) and I want the image to go at the top of the view, not at the middle of the view. If I use imageView.contentMode = UIViewContentModeScaleAspectFit; it fills…
Gik
  • 528
  • 5
  • 18
1
vote
1 answer

UILabel for UIImageView that has contentMode UIViewContentModeScaleAspectFit

I need to set a label that has a custom background color on top of a UIImageView. The problem is that I want it's width to be the exact size as the image from the image view is. This is the code so far: UIImageView *pictureV = [[UIImageView alloc]…
Andra Todorescu
  • 628
  • 10
  • 27
0
votes
2 answers

iOS UIButton image contentMode flickering on TouchUpInside

I have a problem with UIButton image if I set its imageView contentMode to UIViewContentModeScaleAspectFill. UIButton *imageButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 200, 100)]; imageButton.imageView.contentMode =…
Borut Tomazin
  • 8,041
  • 11
  • 78
  • 91
0
votes
0 answers

Unable to save the translate page node

I have enabled the Content Moderation Module for all the content types. Unable to save the translated content, when editing the existing translated content. And getting this below message. Fields applicable to all languages ​​are hidden to avoid…
logeshvaran
  • 135
  • 1
  • 8
0
votes
1 answer

Vaadin add custom validator and content mode

There are some fields to validate. Field's captions contains formatting like ", ", etc with the option captionAsHtml="true". When using someField.addValidator(..., errorString), the error message shows errorString and the field name in…
Alex Roo
  • 1
  • 1
0
votes
1 answer

How to get rid of a jaggy ImageView border when scaling down a big image?

I have a bunch of round Images. They are in png with a 512x512 size. I took them from Flaticon. To display images in a tableView I use imageView with a 45x45px size and Content Mode as Aspect Fit. Images put in a project assets.xcassets folder with…
artexhibit
  • 198
  • 3
  • 17