Questions tagged [uiimageview]

An image view object provides a view-based container for displaying either a single image or for animating a series of images in iOS. For animating the images, the UIImageView class provides controls to set the duration and frequency of the animation. You can also start and stop the animation freely.

Filter by
Sorted by
Tagged with
0 votes
1 answer
30 views

After UIImage rotation white lines appear

I face a problem when after UIImage rotation the white lines appear on sides of the image. In my image redactor I have rotateButton. After tapping on it I call this function: func rotateLeft() -> ...
Petr Bones's user avatar
0 votes
1 answer
45 views

Why CGImage size changed after resize with transparent background? And how to lower the memory cost?

I want to enlarge an image and fill the space with white color. func resizeImageWithTransparentBackground(originalImage: UIImage, targetSize: CGSize) -> UIImage? { let originalSize = ...
magic_9527's user avatar
1 vote
1 answer
28 views

iOS - Obtaining localised system image

I am referring to SF Symbols app for available system icons. If I have to use the asset, I could directly use the systemName to create UIImage. Recently I noticed that there is something called ...
iOS's user avatar
  • 3,590
0 votes
1 answer
32 views

Increasing memory usage in iOS using a UISlider to update a UIImageView's image

I'm quite new to Swift and iOS development and I have encountered a issue while building an app. In a ViewController I have a ScrollView with nested inside a UIView with two UIImageView children ...
Fabio Bassi's user avatar
-1 votes
1 answer
33 views

UIImageview is not scaling to its frame when image is set

Here I have attached the screenshot that I have worked. I am facing an issue that image view is not scaling to the frame. I have created a custom view within the custom view i have added imageview and ...
Arun's user avatar
  • 91
0 votes
1 answer
31 views

Cannot force image to be rounded in custom UIImageView

I have a custom UIImageView that acts like a 'carousel' in that users can swipe it to see an image (which, by the way, I adapted from this excellent post on Medium. I want the corners to be rounded to ...
Moses Harding's user avatar
0 votes
0 answers
41 views

swift: load UIImage from local path

The app I'm making has the following features. Displays a list of articles in a table view. You can add a post to the post list using the new post function. You can include images when writing a new ...
apple.cat.4683797's user avatar
0 votes
0 answers
24 views

How do I make several ImageViews scale based on the screen size without changing their position relative to each other?

A part of an app I'm making in Kotlin in Android Studio contains a map with provinces. (See image) Replication of map of the Netherlands All of the provinces are different ImageViews, because I need ...
SinglePaper's user avatar
0 votes
2 answers
118 views

PNG images render incorrectly in running iOS app

I have two pencil sketch PNGs which I'm rendering within UIImageViews in an iOS app. The images on the left render correctly—the strokes are thick. This is how they appear in Figma, on my computer, ...
Plato's user avatar
  • 185
0 votes
1 answer
44 views

Collectionview cells are not showing according to screen width

cells are not showing in particular order i need 3 cells in a row so tried CGSize(width: UIScreen.main.bounds.width * 0.3, height: 100) but getting unrelated out put code: class ViewController1: ...
User123's user avatar
  • 41
0 votes
1 answer
26 views

UIImage Sizing in Dynamic Collection View Cell with Autolayout and UICollectionViewCompositionalLayout

Context: I have a collection view with dynamic cell height defined by its cell's content. The cell's content: a UIView, a UILabel, and a UIImage (image and label vertically positioned). Problem: ...
robinyapockets's user avatar
0 votes
1 answer
13 views

imageView.layer.origin not working correctly in UIPageViewController's first view controller

I have a UIPageController that controls my view controllers (an array of custom type TipViewController). On TipViewController, there is a UIImageView called pointerView. Its position is adjusted to a ...
Lena Verhoev's user avatar
0 votes
2 answers
46 views

Change image scale in UIImageView

I'm trying to change the image scale in a UIImageView, I want it to be smaller and keep its ratio. I tried: cameraPhoto.image?.scale = CGFloat(0.5) but it doesn't work. I get: Cannot assign to ...
user avatar
0 votes
0 answers
23 views

Image Srink After Splash Screen Swift

We are creating a replica for splash screen with some animation. So we are using same image on full sreen on LaunchScreen.storyboard with top, bottom, leading and trailing. Now I use same constraint ...
Gagan_iOS's user avatar
  • 3,768
0 votes
1 answer
27 views

Small size UIImageView display image becomes blurred

My picture will be blurred in a small size (153x153) UIImageView, but it will be displayed normally in another large size UIImageView (375x375) page, and i load the image using sd_setImageWithURL ...
yonghong's user avatar
0 votes
2 answers
50 views

How to add "UISwipeGestureRecognizer" and "TapGestureRecognizer" in Same viewcontroller in swift

I need left swipe gesture for my viewcontroller and in the same viewcontroller i have one imageView if i click that imageView i need to use "UITapGestureRecognizer" and push to another ...
learn_swift's user avatar
0 votes
1 answer
37 views

Applying mask to UIImageView results in wrong mask placement

I have an UIImageView and another view overlapping it which allows me to draw in it. When I draw something, it has the correct dimensions and placement, but when I try to apply that as a mask on the ...
vajzs16's user avatar
  • 18
0 votes
1 answer
59 views

How to detect when two CAShapeLayers intersect and to change the color of the intersecting pixels

I have a class called ShapeView which subclasses UIImageView. Within this class, there is a CALayer property called shape which I use to define various types of complex shapes. Using ...
Ser Pounce's user avatar
  • 14.3k
0 votes
0 answers
24 views

Detecting force of pressure on Custom ImageView in UIKit

I have developed a custom ImageView in my iOS app that can be moved around by the user. Now I want to determine the precise pressure applied to the ImageView using 3D Touch while it is being moved. ...
Sipos Péter's user avatar
1 vote
0 answers
57 views

How to check one condition in two scenarios when app enters in foreground in swift

I have two image upload buttons 1st in profile pic upload button i am using UIImagePickerController 2nd in file and image upload button i am using HSAttachmentPicker library code: when i open camera ...
new dev's user avatar
  • 45
1 vote
0 answers
30 views

Big gap between navigation bar and image view

I want to have an image attached to the navigation bar in the top, and I've set the constraint for aligning the top to the Safe Area. However, I'm still getting a gap between the navigation bar and ...
jesusjimsa's user avatar
-1 votes
1 answer
23 views

Resizing UIImageViewFrame to match size of image

I have the following view setup: private func setupViews() { let containerView = UIView() containerView.clipsToBounds = true containerView.backgroundColor = .gray view.addSubview(...
Kex's user avatar
  • 8,130
0 votes
1 answer
33 views

How to make an IBDesignable image down sampling function in Swift?

I faced and issue with images using too much memory when running the app. A 905kb SVG image was taking around 150mb when presented and this image was being cached by the system. Loading several ...
Zyfe3r's user avatar
  • 653
0 votes
1 answer
257 views

iOS Swift Get Image Coordinates in UIImage With GestureRecognizer

I've got a simple app that displays an image inside a ImageView which is inside a scrollview which in turn is in a stack view along with some buttons. I've set up the imageview/scrollview to be able ...
rdk's user avatar
  • 91
0 votes
1 answer
94 views

Custom Review star images not showing properly in Swift

I have taken 5 imageviews in storyboard and connected outlets like this @IBOutlet var starRatingImageViews: [UIImageView]! and i am getting string value from json for rating like this rating = "...
swift doubts's user avatar
-1 votes
2 answers
281 views

iOS swift displaying image with text on uilabel

In my app i need to display the text content along with image in UILabel like this but i am only able to display text along with image like this text string in UILabel is starting from the bottom of ...
Abhinandan Pratap's user avatar
0 votes
0 answers
13 views

Image loaded from documents in Swift get rotated in imageview [duplicate]

I'm currently saving and loading images from the documents folder using Swift. The image is saved and loaded fine, but some images get rotated when loaded into an image view. This is my saving code: ...
Jon Magnar Nesvik's user avatar
0 votes
1 answer
32 views

Image not filling the UI View

I am trying to create a profile page that has a user image in a UI View. However, when I load the image it does not fill the circular UI View I created. Here is the code: profileImageView....
Cathy's user avatar
  • 11
0 votes
1 answer
126 views

Layout issue with UIStackView with distribution .fillEqually is ignoring spacing

I have a layout issue I'm struggling to fix. I have a stack view in a tableview cell and I am trying to programmatically add images with different layouts based on the number of images. There's one ...
CristianMoisei's user avatar
-2 votes
2 answers
869 views

UIImageView with fixed height: How can I get the image view width to grow or shrink to match the aspect ratio of the image?

I am not supplying code because this is purely a conceptual "how to achieve this" question. But I have listed my attempts and the constraints below. I've tried a few different strategies to ...
StainlessSteelRat's user avatar
-2 votes
1 answer
26 views

iOS / ObjectiveC: I try to open a viewcontroller with an imageview containing a local image, but it displays a white page

I precise that when I use the debugger, I can see the image in the image view. Why it displays a white page ? (I can see the back button) - (void) openIMAGE:(NSIndexPath *) indexPath { NSString *...
ΩlostA's user avatar
  • 2,541
-2 votes
1 answer
117 views

Infinite spin animation with "ease in" and "ease out" in Swift? [closed]

I want to create a "roulette" (a simple UIImageView with appropriate image) and spin it. There are similar questions but they describe just how to spin with linear speed by using multiple ...
Gargo's user avatar
  • 1,177
0 votes
1 answer
137 views

`UIImage.RenderingMode.automatic` - how does it choose the actual mode?

As per Apple docs, the rendering mode of .automatic for a UIImage leads to a behavior where the image is drawn "using the context’s default rendering mode". What is this "context's ...
Isaaс Weisberg's user avatar
0 votes
1 answer
109 views

Swift ImageView's top Constraints looks wrong and covered its superView?

I want to achieve a "show more" effect in my view. The desired effect is as follows(sorry for my poor painting), the view's height is set to a specific value at first(such as 304), and when ...
malcopolocei's user avatar
1 vote
1 answer
75 views

How to make UIImage fully opaque so that nothing shows through from the background?

I have a UIImageView that I am making a child view of a larger UILabel, using addSubview:. Part of the image (a PNG -- using UIImage) has a transparent background and part of it does not. This is ...
Alyoshak's user avatar
  • 2,696
0 votes
0 answers
44 views

How to achieve something like this using GPUImage3 in iOS application?

I wanted to achieve something like this using CIFilter. here I'm googling a lot but not finding any best solutions. Thanks in advance. I tried in many ways but nothing worked for me. When I googled ...
Mohit Agrawal's user avatar
0 votes
1 answer
84 views

UICollectionView cell loads one image on top of another image

I had everything working perfectly in test. In production, a user saved a few images, two are ok but for some reason, two are doubling up on top of another image. When tapping on the image (...
daj mi spokój's user avatar
0 votes
0 answers
68 views

Difference between SDWebImageDownloader and SDWebImageManager.shared.imageLoader in SDWebImage5.x?

I want to know what is the difference between using SDWebImageDownLoader and SDWebImageManager.shared.imageLoader. Recently I update SdWebImage from 4.x to 5.14.3, and I found that SDWebImage.shared()....
malcopolocei's user avatar
0 votes
1 answer
26 views

Set UIImageView Constraints programatically and activate the same

I have existing view in which I need to add UIImageView and UILabel at top below safe area. Following is the way I create both UIImageView and UILabel private var cardLbl: UILabel = { let label = ...
Sagar's user avatar
  • 1,296
0 votes
1 answer
55 views

Change Text When UIImage in a UIImageView Animation Changes

In my app, I need to set up an animation that will run on repeat until I perform an action on it. I want both an image to change, and text change along with it. I am trying now the suggested key frame ...
user717452's user avatar
0 votes
1 answer
80 views

Make buttons positioned on the right of the view after rotation or pinch in swift

Image editing app. It can zoom the image with pinchGesture, rotate it with rotateGesture and drag from corners to adjust image size. The image has 2 buttons near it. A rotate button - this one ...
Stefan's user avatar
  • 35
1 vote
1 answer
119 views

Resize ImageView by pressing on a circle on it's corner and dragging it to make it smaller/bigger

I've been doing this small app that contains a UIImageView. I can tap on it and 4 circles on each corner of the image should appear. I have to be able to drag my finger from the corner to resize the ...
Stefan's user avatar
  • 35
-1 votes
1 answer
151 views

iOS Button background image not working. (UIButton backgroundImage) [duplicate]

(A) Following line change the image in my imageview. [(UIImageView *)[cell viewWithTag:400] setImage:[UIImage imageNamed:@"sellsign"]]; (B) Following code change only Title of button. [ I ...
Parth's user avatar
  • 19
-1 votes
2 answers
74 views

UICollectionView UIImage with .aspectFill is changing contraints

I have a very simple collection view that has images in it, my Cell class looks like this: class ImageListCell: UICollectionViewCell { @IBOutlet weak var btnDelete: UIButton! { didSet { ...
William T.'s user avatar
  • 13.4k
0 votes
0 answers
49 views

UIImageView loading from URL with cancellable task and safe to use in a UICollectionView

I am trying to make a UIImageView class / extension that can load an image from a URL. the image view should not get confused with concurrency when scrolling through a UICollectionView and the data ...
Halpo's user avatar
  • 3,034
1 vote
1 answer
92 views

How to provide a cornerRadius to a UIImageView with contentMode set to scaleAspectFit

I have an image which has contentMode set to scaleAspectFit with a cornerRadius but i don't get the rounded corner but when I set the contentMode to scaleAspectFill it works. My question is i still ...
chevi99's user avatar
  • 133
0 votes
2 answers
351 views

Application crashed while downloading SVGImage using SDWebImageSVGCoder

I'm using SVG image in my project which is coming from API, as I know there's no direct method to use,load or download SVG image directly into iOS Swift app So I'm using third party library which is ...
Murtaza Mehmood's user avatar
0 votes
1 answer
32 views

How would you call this Void return type function as a method using its given arguments?

This feels like a simple error that I'm just not understanding. I'm trying to call my downloadImage() function on cell.profileImageView (UIImageView) yet I'm receiving an error stating: Cannot ...
TaeVon Lewis's user avatar
1 vote
1 answer
459 views

UIImageView intrinsic content size behavior with Dynamic Type

I have an image view with its image set with a custom image (svg file with Preserve Vector Data selected). The image view has no constraint and it is told to adjust image size with accessibility. When ...
standousset's user avatar
  • 1,092
0 votes
0 answers
468 views

How to open Whatsapp to share image from url in Swift App?

i want to use Whatsapp share image in my Swift app using Xcode, the image will be downloaded from url , its working fine but the problem is that when i click on Whatsapp share button it doesn't open ...
noorapps's user avatar

1
2 3 4 5
213