FAQ Database Discussion Community


Error in overriding image property of ImageView

ios,iphone,uiimageview,uiimage,abstract-class
I am trying to override getter of ImageView to return placeholder image if imageView not settled, But I have error and I can not do it. Why this happens and how can I solve this problem? My code @implementation OvalImageView - (UIImage *)image { return _image? _image : [UIImage imageNamed:@"avatar-big-placeholder"];...

Detect UIImageView Touch in Swift

ios,swift,uiimageview
How would you detect and run an action when a UIImageView is touched? This is the code that I have so far: override func touchesBegan(touches: Set<NSObject>, withEvent event: UIEvent) { var touch: UITouch = UITouch() if touch.view == profileImage { println("image touched") } } ...

Create gradient on UIImage for text

ios,objective-c,uiimageview,uiimage
I am trying to replicate the gradient found on the bottom of these album artwork image views. It makes it very easy to read the text no matter what the background is. How would I recreate this? ...

Is it possible to adjust textview with small picture inside it?

ios,swift,uiimageview,uitextview
I moved from android to Swift. In android we could assign a drawable to the left or right of the text, we could do this in XML. for example this XML for a textView with picture on the left: <TextView android:id="@+id/myTextView" android:layout_width="match_parent" android:text="This is test text view and it is...

How to change size of a tableview if there is no image to load

ios,objective-c,uitableview,uiimageview
I´m doing a View with a TableView and a ImageView. I want to load a image from a URL and change the size of the ImageView component if needed. But in other hand, if there isn´t any image from the URL, I want to hide the ImageView component and makes...

How to refresh an UIImage in an UITableViewCell?

ios,objective-c,uitableview,swift,uiimageview
This is how I create my cells : func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("FbFriendCell") as! FbFriendCell cell.initialize() return cell } Very simple. In the initialize() function, I download an image and I put it in an UIImageView : let theImageView = UIImageView(image: userPhoto)...

Setting the image taken from the gallery to the UIImageView

ios,swift,uiimageview,uiimagepickercontroller
The problem am facing is placing the picture i choose from the gallery into theUIImageView (imageChosen). The code runs fine without any errors but the picture i chose is not set to the "imageChosen" here is my code class postChoices: UIViewController { @IBOutlet weak var imageChosen: UIImageView! @IBAction func gallery(sender:...

Adding gesture recognizer to UIImage, not UIImageView

ios,objective-c,uiimageview,uiimage,uigesturerecognizer
I have a UIImageView whose 'View Mode' is set to 'Aspect Fit' in Interface Builder.I want to add gesture recognizer to only my image inside of the UIImageView.To clarify what i say: I have a UIImageView whose bounds.size.width = 100; and bounds.size.height = 100; and I have a UIImage whose...

UIImageView height and width changes after rotation

ios,objective-c,uiimageview,transformation
Hey guys I've been trying to use two UISliders to manipulate one UIImageView. One slider to scale the image and one to rotate it. However, when I switch from one slider to the other it resets the previous rotation. (So if I scale the image to say 125x125 when its...

UIImage not shown as expected

ios,objective-c,uitableview,uiimageview,uiimage
- (void)showImageAtTableView:(UITableView *)tableView forRowAtIndexPath:(NSIndexPath *)indexPath { if ([tableView indexPathsForSelectedRows].count) { if ([[tableView indexPathsForSelectedRows] indexOfObject:indexPath] != NSNotFound) { //cell is expanded CGFloat frameHeight = [[self.widthArray objectAtIndex:indexPath.row] floatValue]; CGFloat frameWidth = [[self.heightArray objectAtIndex:indexPath.row] floatValue]; //CGFloat yOrigin = [self configureHeightForRowAtIndexPath:indexPath]; CGRect imageFrame = CGRectMake(0, 12, frameWidth,...

Trying to place a UIView over top of a UIImageView to highlight a section of UIImage

ios,uiview,uiimageview,uiimage
I am building an app that displays text from a book on the screen. The text of the page is aUIImage, and is contained inside of aUIImageView on the screen. What I would like to do is highlight each line of the page, using aUIIView that is placed over top...

Why can't I access to nested UIView from viewWithTag method using StoryBoard?

ios,objective-c,uiview,uiimageview
I created some UIImageViews inside a nested UIView by Storyboard and I created a different TAG for each UIImageView. This is how the tree of the ViewController looks according to Storyboard: ViewController View ViewNested UIImageView1 UIImageView1 UIImageView1 UIImageView1 I have to change programmatically these ImageViews so, to get the images...

Image rotation around the lower right edge iOS

ios,xcode,uiimageview
I am trying to rotate the Image around the lower right edge. Now it rotates around the center. CATransform3D transform = CATransform3DIdentity; transform.m34 = 1.0f/-800.0f; // perspective transform = CATransform3DRotate(transform, (M_PI * 90), 0.0f, 0.0f, 1.0f); if (animation) { [UIView animateWithDuration:0.9 animations:^{ [[_sendRecordView layer] setTransform:transform]; } completion:NULL]; } else {...

Fit a UIImageView to a UIImage

ios,objective-c,uiimageview,autolayout
I have a UIImage View that is set up using AutoLayout and constraints. I fit the image to the Image View using self.selectPhoto.contentMode = UIViewContentModeScaleAspectFit; NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide attribute:NSLayoutAttributeBottom relatedBy:0 toItem:self.selectPhoto attribute:NSLayoutAttributeTop multiplier:1 constant:-10]; NSLayoutConstraint *bottomConstraint = [NSLayoutConstraint constraintWithItem:self.selectPhoto attribute:NSLayoutAttributeBottom relatedBy:0...

How to remove black edge on UIImageView with rounded corners and a border width?

ios,objective-c,uiimageview,quartz-graphics
I have the following code to make the UIImageView in each of my UITableView's cells have rounded corners: - (void)awakeFromNib { // Rounded corners. [[cellImage layer] setCornerRadius:([cellImage frame].size.height / 2)]; [[cellImage layer] setMasksToBounds:YES]; [[cellImage layer] setBorderColor:[[UIColor whiteColor] CGColor]]; [[cellImage layer] setBorderWidth:3]; // Trouble! } I want the images to have...

Strange behavior when adding UIButton to UICollectionViewCell

ios,objective-c,uiimageview,uibutton,uicollectionviewcell
I'm trying to add aUIButton to aUICollectionViewCell. The main purpose of the button is to let users to select their favourites. When they click on theUIButton, the UIButton will display a glowing star image, showing that the item has been picked as favourite. Click on the UIButton again, and the...

Theres is a way to be notified in swift if an UIImageView image has been set?

ios,swift,uiimageview,uikit
if UIImageView were my class I would have solved this by doing: class myUIImageView{ var image : UIImage? { didSet { if self.image != nil{ //do my stuff } } } //Other fields and functions } What I want is to be notified (Observer Like) ...

How to release memory for UIImageView (Swift)

ios,iphone,swift,uiimageview
I got a problem with UIImage. I've manually added UIImageView objects to a scroll view. The problem is : when I have more than 50 images, memory will increase to around 200MB, and the app will be crash on iphone 4 or 4s. I want to release memory for images...

Rotate Annotation Custom Image

ios,uiimageview,mkannotation
I am clearly not getting this. I'm trying to work out how to rotate a custom image of map annotations. i.e. multiple icons pointing different directions. I have loop'ed over a whole bunch of airplane data and I want to simply show the direction the plane is heading. I have...

UIImage takes up much more memory than its NSData

ios,memory,uiimageview,uiimage
I'm loading a UIImage from NSData with the following code var image = UIImage(data: data!) However, there is a weird behavior. At first, I used png data, and the NSData was about 80kB each. When I set UIImage with the data, the UIImage took up 128kb each. (Checked with Allocation...

Why do my image views placed inside a scroll view have distorted heights?

ios,swift,uiscrollview,uiimageview
I have an array of UIImageViews with each a different image and a function that places them inside a UIScrollView so they can be automatically scrolled like a slideshow. My scroll view has a height of 150 pixels and the images are 400x150 PDF's. For some odd reason on the...

Performing actions when selecting image from UI [closed]

ios,swift,uiimageview,popup,xcode-6.2
I have a UIView that has: Image View Text View Scroll View (it has multiple images which are dynamically created in run time) what I need to do is: when I select an Image (either the first image ,or the one from the scroll view) a pop up window shall...

image view not scrollable in scrollview and not fit properly using pure layout

ios,objective-c,uiscrollview,uiimageview,pure-layout
I'm simply trying to place an image into scroll view which is in a main view using purelayout. And what i'm taking right now is; Note that view with red background is scroll view. And also the image is not scrollable. - (void)loadView { self.view = [[UIView alloc] init]; [self.scrollView...

combining UIImageView with UIView and save it as a Image

ios,iphone,swift,uiview,uiimageview
I am writing a small app that takes a photo and do modifications to it. There is a feature to put stickers(images) on top of the taken photo. I want the user to be abel to pinch rotate and drag the stickers so I used a UIImageView to contain the...

iOS: Image view aspect fit with corner radius

ios,uiimageview,uicollectionviewcell
I want to set corner radius with content mode as aspect fit using following code: cell.imgvAlbum.contentMode = UIViewContentModeScaleAspectFit; cell.imgvAlbum.clipsToBounds = YES; cell.imgvAlbum.layer.cornerRadius = 5.0f; but i am getting output only for content mode as aspect fit. I have also tried for: cell.imgvAlbum.layer.masksToBounds = YES; What to do for corner radius?...

Turn FBProfilePictureView into UIImage

ios,objective-c,facebook,uiimageview
I have a Facebook login that gets the users profilePicture, lblUsername, and lblEmail. I know that the FBProfilePictureView is a UIView that contains a UIImageView. So, what I am asking is how do I convert or "save" the profilePicture that you get from Facebook as a UIImage? Here is my...

Cannot create a connection between a UIImageView and the ViewController.h

ios,objective-c,uiviewcontroller,uiimageview
I cannot create a connection between theUIImageView and the ViewController.h. When I try to type it up manually, and drag the line to theUIImageView, it doesn't highlight theUIImageView, and the connection is not made. When I tried to connect it automatically, but the connection was also not made. Can you...

Should I put UIIMageViews directly in the View of the Controller?

xcode,swift,uiimageview,storyboard
I am writing an app for both IPad and IPhone. I want to put multiple images in the view. I wanted to ask what is a better practice. Should I put multiple views inside the main view and put autolayout constraints on the views and then put UIImageViews taking whole...

Triangular UIImageView mask IOS

ios,objective-c,uiimageview,uigesturerecognizer
Check attached screenshot. This is What I have done. I have created UIImageView in storyboard and assign image (pink triangular image) to imageView. I have used gesture to recognize drag (right side, half of screen) event on image. Actually, I need drag event only when I click and drag from...

Which Image will be used on iPhone 6 device

ios,objective-c,iphone,uiimageview
I have added @1x, @2x, & @3x images in asset catalog. @2x will be used in iPhone 4/4s, iPhone 5. @3x will be used in iPhone 6 Plus. So in iPhone 6 which image will be used? ...

Animation in TableViewCell at reloading data time

ios,objective-c,uitableview,animation,uiimageview
I have UITableViewCell with detailed arrow that points to top or to down. Than I tap on this cell I want to expand it. So I will reload UITableView and I want to animate rotation ofUIImageView`. Question - is it possible to animate rotation of UIImageView simultaneously with reloading data...

How to remove space of hidden UIImage?

ios,uiimageview,autolayout
I'm stuck that I don't know how to remove spacing of hidden UIImage. Purpose is If flag is true, UIImage will be displayed and if flag is false, UIImage is hidden but space of this hidden image is still there. I'm using Auto Layout. ...

Create Hexagon ImageView shape in iOS

ios,uiimageview,uiimage,core-graphics,uibezierpath
I want Above Hexagon shape for my ImageView. But After implementing below code I am getting this Image - (UIBezierPath *)roundedPolygonPathWithRect:(CGRect)square lineWidth:(CGFloat)lineWidth sides:(NSInteger)sides cornerRadius:(CGFloat)cornerRadius { UIBezierPath *path = [UIBezierPath bezierPath]; CGFloat theta = 2.0 * M_PI / sides; // how much to turn at every corner CGFloat offset =...

How do I make a UIImageView “flickable”?

ios,swift,uiimageview
I have a UIImageView that the user can move around, but I want the user to kind of swipe it or "flick" it in a direction and it will fly off in the direction the user swiped/flicked it. Here is the code for the UIImageView: @IBOutlet var imageView: UIImageView! var...

Setting specific image to UIImageView

ios,objective-c,random,uiimageview
I have 10 images named 0.png to 9.png and also a randomiser give me a random number between these 10. And well depending on the number the randomiser gives me, I want to set my UIImageView with that image. My idea was to do it like this: [image setImage:[UIImage imageNamed:...

How can I get an image to fit the whole screen?

ios,swift,uiimageview,xcode6
I'm new to Swift, and I'm trying to make an image in a tabbed application fill the whole screen. This is what I've got so far. let imageName = "bkgrd" let image = UIImage(named: imageName) let imageView = UIImageView(image: image!) imageView.frame = CGRect( 0, 0, 100, 200) However this doesn't...

Swift - Passing an UIImage to an UIImageView via delegation

ios,swift,uiimageview,uiimage,protocols
I'm out of ideas and I have no idea how to solve this. Any help will be appreciated. I've got the following situation: MainViewController which points to a CollectionView embedded in a NavController CollectionView points to a DetailViewController DetailViewController shows the full picture chosen in the CollectionView and has a...

ImageView image not being drawn when viewcontroller bgcolor is being set

ios,objective-c,uiimageview,uiimage
running into a weird issue. Within the prepareForSegue method in my HomeViewController.m file, I'm doing this: -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(UIButton *)sender { StarViewController *nextViewController = segue.destinationViewController; nextViewController.title = segue.identifier; if ([segue.identifier isEqualToString:@"redDwarfSegue"]) { //nextViewController.view.backgroundColor = [UIColor redColor]; nextViewController.starImage = [UIImage imageNamed:@"image1"]; } else { nextViewController.view.backgroundColor =...

Swift - Checking size of UIImageView

ios,swift,uiimageview,size
I am trying to print a line to the debugger/console to show the dimensions of the UIImageView object I have. I was trying to use the following code but get an error saying UIImageView doesn't have a member named 'size'. This was my code: @IBOutlet var Image: UIImageView! override func...

How to make Image page viewer for images swift ios

ios,swift,uiimageview,uiimage,uipageviewcontroller
I wanna display a couple of images from the assets folders, into my application. so I wanna make a page view. First, images will be inside collection view, then on click, the image will be full screen. Then the user can slide between the images by swiping right and left...

UICollectionView not showing images from CameraImage - Objective C

objective-c,camera,uiimageview,uicollectionview
Searched the forum and could not find a suitable answer that works. I suspect something is wrong with the code. I am taking pictures with a camera and trying to show them in a UICollectionView. The collectionView has a cell with a UIImageView inside of it. Even when setting a...

Add shade gradient to the bottom of a uitableviewcell / uiimageview

ios,objective-c,swift,uiimageview,gradient
Does anyone know how add a gradient to the bottom of a uitableviewcell or the uiimageview like the image shown below does? ...

getting error GestureRecognizer with UIImageview in swift

ios,iphone,swift,uiimageview,uigesturerecognizer
i am using 20 uiimageview so i have given tag value of each imageview now i want to add GestureRecognizer on each image view for index in 0 ... fields.count - 1{ let gestureRecognizer = UITapGestureRecognizer(target: self, action: "fieldsTappedAction") gestureRecognizer.numberOfTapsRequired = 1 println(fields[index]) fields[index].addGestureRecognizer(gestureRecognizer) } now i am trying to...

How can I change image positions after creating in loop and making them subviews?

ios,objective-c,uiimageview
In my app I have several 'for' loops like this: for (int i = 0; i <= 100; i++) { cmMajorMarker = [[UIImageView alloc] initWithImage:image]; cmMajorMarker.frame = CGRectMake(0, 0, widthVar,heighVar); cmMajorMarker.center = CGPointMake(xVar,yVar); [self.scrollView addSubview:cmMajorMarker]; } (small edit: above code is significantly simplified, which is why it appears to do...

Why does NSArray of UIImageViews follow a certain pattern?

ios,objective-c,arrays,uiimageview
I have an array of 4 UIImageViews A, A2, A3 and A4. I want them to be dragged on to another imageView called answerA. Every time I drag one of them on the answer it should change the image on answerA to a number which tells how many were dragged...

IOS how to download image from URL [duplicate]

ios,objective-c,uiimageview
This question already has an answer here: iOS download and save image inside app 8 answers I have a URL image on the server. I use this to save avatar. How to I can use URL to download image and set in my ImageView....

Swift: Edit image taken from camera to fill a UIImageView

ios,image,swift,uiimageview,scale
I have used a UIImageView that takes its image from the default camera app using UIPicker. But the image I am getting is too small to fit into the image view and if I use: imageView.contentMode = UIViewContentMode.ScaleToFill While this indeed scales to fit the image view the picture looks...

Load images from “HTTPS” type of url and display in UIImageview

ios,objective-c,https,uiimageview,xcode6
I am developing an iOS app in which I receive "HTTPS" URLs from server for images. I am now unable to load images from those URLs. I have tried several frameworks like AFNetworking, SDImageView, etc. But none of them are able to load image from these type of URLs. Update:...

Rescale image so width is half the size of screen

ios,swift,uiimageview,uiimage,image-scaling
I'm fairly new to swift and I'm currently trying to display multiple image views within a custom UITableCell. Ideally, I would like to have each image be scaled so that its width fills half of the screen size (while preserving the original aspect ratio). The idea is that each UITableCell...

UIImageView not presenting image in correct orientation in iPhone

ios,objective-c,iphone,uiimageview,orientation
I have tried alot of solutions but non has worked yet Heres what i am doing: if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.modalPresentationStyle = UIModalPresentationCurrentContext; //imagePicker.allowsEditing = YES; NSOperatingSystemVersion ios8_0_0 = (NSOperatingSystemVersion){8, 0, 0}; //This was suggested...

Trying to make simple UIImageVIew animation

ios,objective-c,uiimageview
I am trying to so a simple UIImageView animation. I have 11 images of .png type. The animation is just a rabbit blinking. I am having issues with the array: UIImageView *animationView = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width/2-123/2, self.view.bounds.size.height/2-278/2, 123, 278)]; NSArray *imageNames = [NSArray...

How to resize image assets for all Apple devices? (not launch images)

ios,iphone,ipad,uiimageview,assets
My app displays 2 buttons on the top and a car picture (1 of 4 possible) at the bottom: Each image file has huge dimensions of 5616 x 3744 pixels and the app lags noticeably and also sometimes crashes (here fullscreen, Aspect Fill mode is used): So I would like...

UIImageView - The image is stretched

ios,uiimageview,uiimage
I loaded the images to the UITableViewCell, but they are obtained stretched. I tried to put the display settings of UIImageView to the AspectFit and AspectFill, but it did not give the expected result. Under the UIImageView there is a UIView. How can I solve this problem? ...

Get image name UIImagePickerController in Swift

ios,iphone,xcode,swift,uiimageview
I use UIImagePickerController to get image from phone library (iOS). After edit mode i put image to my UIImageView. I want to save this image in Core Data to use it in another View Controllers How can i do it in Swift. If it is not possible what options do...

UIImageViews not scaling correctly in UIScrollView with paging

ios,swift,uiscrollview,uiimageview,scroll-paging
I'm trying to build a very simple UIScrollView with several images where paging is enabled. However, I can't seen to get the images to correctly be resized to the bounds of my UIScrollView. The images are always bigger than the bounds, thus messing with my paging. I have a UIScollView...

Load UIImage from URL in iOS

ios,objective-c,uiimageview,nsurlrequest,imageurl
I am trying to load a UIImage from its URL with completionand placeholder image , but neither the UIImage nor the placeholder UIImage are loaded. Here is my code: NSURL *url = [NSURL URLWithString:@"http://assets.gearlive.com/tvenvy/blogimages/stewiegriffin.jpg"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [self.imageView setImageWithURLRequest:request placeholderImage:[UIImage imageNamed:@"bg.png"] success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {...

iOS - incompatible pointer types

ios,uiview,uiimageview
I get an warning: incompatible pointer types assigning to 'UIImageView' from 'UIView' with this code: if ([gestureRecognizer.view isKindOfClass:[UIImageView class]]) { curgraphicview = gestureRecognizer.view; } The code actually work. But in this case, How can I make it so that I don't have warning?...

UIImage slide on/off inside UIImageView iOS

ios,objective-c,iphone,uiimageview
I have a UIImageView in the center of the screen (Position Set with the help of the constraints through the storyboard) In the code's viewDidLoad method I set the image for that imageView by: self.imageView.image = [UIImage imageNamed:@"food"]; Then I wanted to slide the old image off from left of...

UIImage at end of UITextView

objective-c,xcode,uiimageview,uitextfield
I have an UITextField, at the end of the textfield I want to add an UIImage. When I put an UIImageView on top of the UITextField, the UIImageView is always (duh!) visible in top of the UITextField. What code do I need to write so that at the end of...

How can I tile the background with UIImageViews with code efficiently?

ios,objective-c,multidimensional-array,uiimageview
I'm working in Xcode 6 on tiling the iPhone background with many UIImageViews and I'd like to know if this is the most efficient solution. I know one simple solution would be to create image views in the storyboard and cover the entire screen with them manually. I'd like to...

Picking two different images using two different imagePickerControllers Swift

ios,swift,uiimageview,uiimagepickercontroller
I am making an app in which there are two UIImageViews. In each image view the user needs to be able to input a different image. Here is the code I have so far. var imagePicker = UIImagePickerController() @IBAction func chooseImage1(sender: AnyObject) { if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.SavedPhotosAlbum){ println("Button capture") imagePicker.delegate = self...

Swift Add transparent color to UIImageView background

ios,iphone,xcode,swift,uiimageview
var controllerScreen = UIImageView() controllerScreen.backgroundColor = UIColor.redColor() This adds red opaque color to the UIImageView. I want to add a transparent red color. Is there any transparent property or something ? ...

ios8 blur effect disappear

ios,uiimageview,uiblureffect
Thanks for reading my question I had some trouble stabilizing the intensity of blur effect I had a UIImageView with blur effect (Extralight) which covered the whole view as a background The intensity of the blur effect looked just fine But after I added items onto the storyboard the blur...

Image changed randomly in table view cell

ios,objective-c,uitableview,uiimageview
I want to change a specific UIImageView inside a UITableViewCell with this: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self.tableView beginUpdates]; UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; UYLTextCell *textCell = (UYLTextCell *)cell; textCell.selected = YES; //get and show the image at selected cell textCell.testImage.image = [UIImage imageNamed:@"image280280.jpg"]; //[tableView reloadRowsAtIndexPaths:@[indexPath]...

How do I make something happen when a UIImageView hits certain points on the screen?

ios,swift,uiimageview
I have a UIImageView that the user can drag around. I want something to happen when it hits (gets dragged over) certain points on the screen (all the points from x: 0 y: 0 to x: 0 y: 100). This is the code I currently use: @IBOutlet var imageView: UIImageView!...

How can CCSprite load ImageURL

ios,uiimageview,ccsprite
UIImageView *imageView = [[UIImageView alloc] init]; [ImageViewHelper setImageURL:productInfo.ImageUrl forImageView:imageView]; CCSprite *imageSprite = [CCSprite spriteWithCGImage:imageView.image.CGImage key:productInfo.ImageUrl]; setImageURL: forImageView: is a multithreaded way, and when I perform to the third step, the imageView does not get loaded successfully, because it's done on a separate queue via multi-threading, but imageSprite needs the imageView.image...

Add UIImageView to UIScrollView

ios,xcode,swift,uiscrollview,uiimageview
Was hoping someone could point out what is wrong with this. My storyboard has a UIScrollView named timelineScrollView and a UIImageView named imageviewtest. I am creating an image that is a simple straight line. If I add it to the UIImageView it displays fine. However if I add it to...

Image overlaps previous view when tapping/swiping back

ios,swift,uiscrollview,uiimageview
I have a UIScrollView which covers one of my views entirely. I have added a background image to this same view which scrolls at a slightly different rate to the actual UIScrollView. This works absolutely fine unless I use the back swipe gesture or tap the 'Back' button. What happens...

UIScrollView and a background Image

ios,uiscrollview,uiimageview
I have a UIViewContainer having a View1-->ScrollView-->View2-->Imageview(background Image) The scrollview is placed below the top layout guide so that the screen doesnt scroll under the battery etc. Because of this the top layout guide is blank/Blue(view's color,no background image). So I added another Imageview to View1 to act as a...

Use AutoLayout to scale down UIImageView height

ios,objective-c,uiimageview,autolayout,uitextview
So, In my app I have an UIView (it resizes keeping the same aspect ratio so that it always touches the sides of the screen) and in that view I have an UIImageView and an UITextView on top of it. Visually (the pink rectangle is the textview): What I want...

How do you build an NSURL for an image in Image.xcassets?

ios,uiimageview,uiimage,uikit
The easiest way to load a local UIImage asset is of course to use +[UIImage imageNamed] but for my case, I want to supply a NSURL *. How do I get a NSURL * for local file?

Swift - UIImageview URL slideshow

ios,swift,uiimageview,xcode6,slideshow
Hello everyone I have a problem I can not solve , I have an application written in Object C and I wanted to make it or rewrite it or compatible with Swift . Being novice with Swift would like to know how I can set this piece of code written...

not getting all images when passing images data to imageview

ios,objective-c,xml,uiimageview
I am parsing xml image urls to imageview in detailviewcontroller but I passed the images through the shareddelegate.but when i click on the tableviewcell only few images occure in detailviewcontroller. imageview.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:sharedDelegate.imagObj]]]; the above code I wrote in detailviewcontroller AppDelegate *sharedDelegate = (AppDelegate*)[[UIApplication sharedApplication]delegate]; sharedDelegate.imagObj =...

Convery my UIImageView to a PFFile in SWIFT

swift,parse.com,uiimageview,pffile
I have a UIImageView in my storyboard, and the user can successfully select an image from their phone to place in the ImageView; however, I'm not sure how to get that from the storyboard to Parse.com. Any code would be much appreciated. There are lots of tutorials on downloading, but...

Get ImageView Image Original Size

ios,objective-c,uiimageview,uiimage
I have a TableViewCell with an ImageView, and I am setting the image like so: [self.contentImageView setImageWithURL:thumbnail_url]; The contentMode is set to UIViewContentModeScaleAspectFill, and the subviews are clipped. This works best for images that are either Portrait or Landscape, but UIViewContentModeScaleToFill actually works better for Landscape images, which are far...

UIImageView in table view not showing until clicked on or device is roatated

ios,uitableview,swift,uiimageview
I am in the process of learning swift/IOS and having a problem with getting an image to display in a table view cell when the imageView is set within a closure passed to dispatch_async(dispatch_get_main_que). Here is my code for returning the cell for the tableview. Notice that the dispatch calls...

Programmatically using constraints to center a UIIMageView

ios,objective-c,uiimageview,autolayout,xib
I'm working on an iOS project in which I need to programmatically use constraints for my views. I'm used to storyboards, but am using xibs for this particular project due to the nature of the project specification. I have a MainViewController, in which I create the following properties in the...

how can I set up a contentMode in my Pictures application?

ios,objective-c,ios7,uiimageview,contentmode
I have a big problem. I am using this method willAnimateRotationToInterfaceOrientation so I can see an image in a certain way when I lay my ipad. The problem is that when I lay my ipad the image besides getting cut is also in the lower left corner. I want her...

How to make text appear in centre of the image?

swift,ios8,uiimageview,uiimage,uigraphicscontext
I want to add a text on an image, and I'm able to do it as shown in below code. func textToImage(drawText: NSString, inImage: UIImage, atPoint:CGPoint)->UIImage{ // Setup the font specific variables var textColor: UIColor = UIColor.redColor() var textFont: UIFont = UIFont(name: "AmericanTypewriter", size: 75)! let textStyle = NSTextEffectLetterpressStyle //Setup...

moving the UIImageView from the main view to another

ios,swift,uiimageview,pass-data
my code works fine in choosing the picture from the gallery and display it in the same view, what am stuck into now, is transferring that UIImageView chosen to the next activity when "next" button is clicked here is the code that opens the gallery @IBAction func gallery(sender: AnyObject) {...

UIImageView pinch zoom swift

swift,uiimageview,uipinchgesturerecognizer
I was hoping someone could help me out. I am trying to allow a user to pinch zoom on a UIImageView(with a max and min level allowed). But for some reason the it does not work right. The image zooms a little then just bounces back. Thank you. here is...

How to delete a drawn CGPoint on a UIImageView

ios,objective-c,uiimageview,cgpoint,drawinrect
I have a UIImageView that i draw on it points . I store my CGpoint in an NSArray with a capacity of 100. Every time i receive a new CGpoint i want to erase the last object from the array , remove it from the array and then draw the...

Hide subview image once the view has loaded (using Swift)

ios,xcode,swift,uiimageview,subview
Technologies: XCode6, iOS 8.2, Swift When the view loads, I add an image: override func viewDidLoad() { super.viewDidLoad() webView.delegate = self self.navigationController?.toolbarHidden = false; openLoadingPopup() if browserHistory.count < 1 { backButton.enabled = false } let imageName = UIImage(named: "image.png") let imageview = UIImageView(image: imageName) imageview.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)...

Slight delay before image blurred

ios,objective-c,uitableview,uiimageview,uiimage
I'm using LBBlurredImage https://github.com/lukabernardi/LBBlurredImage with this tutorial http://www.raywenderlich.com/55384/ios-7-best-practices-part-1, and was wondering why it takes a second when a UITableViewCell is supposed to blur (when swiping up immediately when the app opens to see the next tableview cell)? When I swipe up to go to the next table view cell, the...

How to avoid the memory issue while scrolling an UICollectionView which loads lot of images from Remote server?

ios,multithreading,memory-leaks,uiimageview,uicollectionview
I'm displaying lot of images (5k images) in UICollectionView. These images has been download from remote server. When I scroll from top to bottom and vice versa of the UICollectionView for 5 to 6 times, my app get crashes and I received error "Terminating app due to memory pressure". Please...

Displaying and scrolling a UIImageView (image) that is longer than screen

ios,objective-c,uiscrollview,uiimageview,autolayout
I have an image I want to display and it is longer than the screen size. The idea is I want it to scroll to show the entire image. I have created a UIImageView inside a UIScrollView and I can see the image in XCode but not when I run...

how dragged image with a min and max value?

ios,objective-c,uiimageview,draggable
I have this code for increase height of a image. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; touchStart = [[touches anyObject] locationInView:self.image]; touchStart2 = [[touches anyObject] locationInView:self.tableView]; isResizingLR = ( self.image.bounds.size.height - touchStart.y < kResizeThumbSize ); } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ CGPoint touchPoint = [[touches...

how do i alter the position of a UIImage inside a imageView SWIFT

image,swift,uiimageview
I have a UIImage called image I want to change the position of it inside the imageView so it can be dragged down slightly, roughly 30px. Can some one tell me how to do it? This is where I am up to but its not coming out correct. var image...

Add different images to UIImageView of cells in UITableView

objective-c,json,uitableview,uiimageview,nsmutablearray
Needless to say, i am a novice. I am trying to add images and text to a UITableView. I have been able to add the text but I am having problems with adding different images to the desired text. I have 2 separate PHP codes for 1 database: The first...

How to occupy the app bottom with an image?

ios,xcode,uiimageview,interface-builder,autolayout
In Xcode I have placed 2 buttons at the top and 1 image (in Aspect Fill mode) at the bottom: All 3 elements are center-aligned. For the buttons I have added 20 px constraints to the sides and top and they seem to be placed well now. However I can...

Blur Effect on TableViewCell when scroll

ios,objective-c,uitableview,ios8,uiimageview
Right now I'm using LBBlurredImage to blur an image, but I want to change to iOS8's UIVisualEffectView to blur instead. I'm having a hard time implementing, any ideas? Implemented with LBBLurredImage: - (void)updateData { // Set up Screen self.screenHeight = [UIScreen mainScreen].bounds.size.height; //UIImage *background = [UIImage imageNamed:@"gray"]; UIImage *background =...

Allow scrolling image up and down in UIScrollView

ios,objective-c,uiscrollview,uiimageview
I have a UIImageView inside a UIScrollView, I also implemented this method: - (UIView*)viewForZoomingInScrollView:(UIScrollView *)scrollView { return self.imageView; } For the image to resize inside the UIScrollView, but I want to allow the user to change the y axis of the image and move it up and down, not just...

UITableView with UITableViewCell containing UIImageView

ios,iphone,swift,uitableview,uiimageview
Okay, so I am only able to scroll outside the borders of the UIImageViews, but I need to be able to scroll on top of those views. The UIImageView contains Pan Gestures, Pinch Gestures, and I am unsure if that is causing the error. I will paste my cell code...

How to calculate UIImageView size?

ios,swift,uiimageview
I have a Swift app which sets a UIImageView to the size of a portion of the screen (set with autoconstraints to the margins and controls above it), and I use the height and width values of the ImageView to create 3 additional UIImageViews programmatically and position them on top...

kCATransitionPush applied to slide in/out image from UIImageview without fade/transparent effects iOS

ios,objective-c,xcode,uiimageview
I have an UIImageView on the screen at some position: self.imageView = [[UIImageView alloc] init]; self.imageView.clipsToBounds = YES; self.imageView.image = [UIImage imageNamed:@"food"]; [self.imageView setFrame:CGRectMake(0, 0 , (self.view.frame.size.width/5), 60)]; I had to then slide in another image inside the UIImageView which I did with the following code: self.imageView.image = NULL; CATransition...

Autolayout, async load image into uiimageview (Swift, xCode6)

ios,swift,uiimageview,autolayout
Good day! I have 2 problems and I hope you will help me. 1) I have news feed in my application, that contains images. I am using Autolayout for dynamic cells: and I want the image to keep its ratio and to completely fill the width of the cell (with...

How to change image of UIImageView that is inside a UIButton programatically?

ios,objective-c,iphone,uiimageview,uibutton
I created a UIButton with UIImageView and UILabel by the help of this question and answer by Tim and now I want change the image of the UIImageView on the button click event. I tried [sender.imageView setImage:image] but it not working

iOS Image Resizing / Dealing With Blank Space

ios,image,uiimageview,scaling
I have simply dragged UIImageView into storyboard and made it square. I added a pink background to show the effects of the leftover space in the ImageView. In each case I added either a taller image (1st image) and a wider image (2nd image), as well as a text label....

Save and segue UIImageView after moving with UIPanGestureRecognizer. Swift

ios,iphone,swift,uiimageview,uipangesturerecognizer
Good day. This is my last option — to ask here. The problem is: I am building multiply view app. On the first screen I have UIImageView that I can move with UIPanGestureRecognizer function: @IBAction func movement(recognizer: UIPanGestureRecognizer) { let translation = recognizer.translationInView(self.view) if let view = recognizer.view { view.center =...

how to create an action for a clicked image from imageviewanimation

objective-c,animation,uiimageview,uigesturerecognizer
[SOLVED - SEE THE ANSWER] i want to have three images grouping as animation, and i can be able to click any of these three images to define an action. In the other words, i'd like to know the ways to create separate action/ event for each image in the...