uiimageview

UICollectionView insertItemsAtIndexPaths: throws exception

大城市里の小女人 提交于 2020-01-13 03:48:54
问题 UICollectionView: I'm doing it wrong. I just don't know how. My Setup I'm running this on an iPhone 4S with iOS 6.0.1. My Goal I have a table view in which one section is devoted to images: When the user taps the "Add Image..." cell, they are prompted to either choose an image from their photo library or take a new one with the camera. That part of the app seems to be working fine. When the user first adds an image, the "No Images" label will be removed from the second table cell, and a

How to Display GIF Image on iPhone UIIMageView

江枫思渺然 提交于 2020-01-12 06:26:07
问题 i have found some ways but they are actually reading frames and applying transition which reduces the quality of animation.. is there any way to display GIF on iPHone application as it is..? Thanks in Advance.. 回答1: Animated GIF won't animate, but if you have a GIF, save each animation as a separate GIF and then setup animationImages array with all those GIFs you just saved: UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds]; animatedImageView

Programmatically change the height and width of a UIImageView Xcode Swift

蹲街弑〆低调 提交于 2020-01-11 19:59:07
问题 Hey for some reason I am struggling with trying to set the height and width of one of my image views. I want to set it so the height only goes for 20% of my screen. I know to regularly set it you can do things like: image = (0,0,50,50) But I need the height to not be a static number. Something like image = (0,0, frame.height * 0.2, 50) Any suggestions? 回答1: The accepted answer in Swift 3: let screenSize: CGRect = UIScreen.main.bounds image.frame = CGRect(x: 0, y: 0, width: 50, height:

Loading images in background to optimize the loading in ios

巧了我就是萌 提交于 2020-01-11 18:32:27
问题 I am trying to optimize the load in my application, in fact, I have a lot of images that loaded in my application, and I spend a lot of time waiting for a view controller to open, especially the first initial view which includes a lot of images. I took a look at apple sample but I cannot re-work the whole application, what I want is just to tell me specifically what should I do?, I implement? in the tableview , where the cell is implemented cellforrowatindexpath: NSURL *imageURL = ......;

Circular UIView with multiple coloured border working like a pie chart

六眼飞鱼酱① 提交于 2020-01-11 12:14:12
问题 I am trying to set a circular avatar of a player of a game with a piechart representation on the avatar's circular border. Player 1 - Wins 25% Lost 70% Drawn 5% cell.selectedPhoto.frame = CGRectMake(cell.selectedPhoto.frame.origin.x, cell.selectedPhoto.frame.origin.y, 75, 75); cell.selectedPhoto.clipsToBounds = YES; cell.selectedPhoto.layer.cornerRadius = 75/2.0f; cell.selectedPhoto.layer.borderColor=[UIColor orangeColor].CGColor; cell.selectedPhoto.layer.borderWidth=2.5f; cell.selectedBadge

iOS: Update launch screen dynamically

狂风中的少年 提交于 2020-01-11 08:32:07
问题 I've designed a launch screen using story board. It's supposed to have 3 images. 2 of these are static, where as, i need to update one at run time (after downloading that from server). My understanding is that we can not add code for launch screen as there is no controller for this at backend. What i want to do is to use some default place-holder for the first time . Download & cache that dynamic image at some other point in application. And when user use the app for the 2nd time, show the

Too many open files iOS

ぃ、小莉子 提交于 2020-01-11 07:40:08
问题 i am new on ios programming, when my app is running , i am taking these errors. I am loading 950+ images in my app and i am using ARC. ImageIO: CGImageRead_mapData 'open' failed '/Users/apple/Library/Application Support/iPhone Simulator/6.1/Applications/16551664-4694-4742-85DC-2C3C0ADC5289/demo.app/menu-24-20.png'error = 24 (Too many open files) ImageIO: CGImageRead_mapData 'open' failed '/Users/apple/Library/Application Support/iPhone Simulator/6.1/Applications/16551664-4694-4742-85DC

iOS swift UIImageView change image in tableView cell

Deadly 提交于 2020-01-11 04:19:06
问题 I have a strange problem in tableView Custom cell . for like Image action I write these code in Custom cell called FeedViewCell : self.like.isUserInteractionEnabled = true let CommenttapGestureRecognizer = UITapGestureRecognizer(target:self, action:#selector(likehandleTap)) self.like.addGestureRecognizer(CommenttapGestureRecognizer) func likehandleTap(_ sender: UITapGestureRecognizer) { if self.like.image == UIImage(named: "like-btn-inactive") { self.like.image = UIImage(named: "like-btn

Save image in UIImageView to iPad Photos Library

自作多情 提交于 2020-01-10 14:25:59
问题 I am creating an iPad app that has several pictures ( UIImageViews ) in a horizontal scrollview. I want to allow the user to be able to save the images to their Photo Library when they tap on one of the UIImageView s. I like the way Safari handles this matter: you just tap and hold until a pop up menu appears and then click save image. I know there is the " UIImageWriteToSavedPhotosAlbum ". But I am a newbie to iOS development and I'm not too sure where to go with it and where to put it (i.e.

how can I get the scale factor of a UIImageView who's mode is AspectFit?

放肆的年华 提交于 2020-01-09 19:16:05
问题 how can I get the scale factor of a UIImageView who's mode is AspectFit? That is, I have a UIImageView with mode AspectFit. The image (square) is scaled to my UIImageView frame which is fine. If I want to get the amount of scale that was used (e.g. 0.78 or whatever) how can I get this directly? I don't want to have to compare say a parent view width to the UIImageView width as the calculation would have to take into account orientation, noting I'm scaling a square image into a rectangular