uiimageview

Fold/curl edge of UIImageView

允我心安 提交于 2019-12-22 09:55:43
问题 I need to fold/unfold the edge of UIImageView to mark as a favorite. I searched across multiple sites, but have not found anything about it. I attached some example images, and, If possible, with animation effect. Thanks!! 回答1: One way to do it would be to animate the view usign OpenGL. There is a nice library for that called XBPageCurl However, you could achieve a much lighter solution by creating a mask for the curl effect and animate your view while transitioning to it. Here is what it

How to add multiple UIImageViews to paging UIScrollView?

徘徊边缘 提交于 2019-12-22 09:09:09
问题 I have a UIScrollView with paging enabled with multiple subviews on the page: a UIButton, UIwebview and UIImageView. Both the webview and the image change on every page. This works fine. I used Apples scrolling image paging example to get me started. But when I add a second UIImageView, the position of image I have in place already gets the new values and the new image doesn't display. This is the code inside viewdidload for the first image (works fine): // load all the images from our bundle

Images Persistence and Lazy Loading Conflict With Dispatch_Async

和自甴很熟 提交于 2019-12-22 09:06:12
问题 I am working on a feed reader and i am doing it by parsing rss feeds using nsxmlparser. I also have thumbnail objects that i am taking from the CDATA block. -(void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSString *someString = [[NSString alloc] initWithData:CDATABlock encoding:NSUTF8StringEncoding]; NSString *storyImageURL = [self getFirstImageUrl:someString]; NSURL *tempURL = [NSURL

How to use NSUndoManager with a UIImageView or CGContext

拈花ヽ惹草 提交于 2019-12-22 08:45:00
问题 I have an app that uses cgcontext to draw things onto a UIImageView that the user draws using touch events, and I want to be able to undo the drawings made by the user. Edit: I am trying to use my touchesBegan to save theUIImage at the begining of a touch to the NSUndoManager And then how do I use it to undo using a UIAlertView. Meaning, I want to call a method from my UIAlertView that undo's then another that will redo, but I don't know how to accomplish this. Please help 回答1: I write

How to make UITextView text all selectable and show copy option to the user iPhone app?

元气小坏坏 提交于 2019-12-22 08:32:04
问题 Am working in iPhone application like iMessage native app. I have designed a page look like iMessage with added a bubbles also. How i done is, just added a UITextView in UITableView Cell and also i have added UIImageView on UITextView with bubble images . Load the text to UITextView from NSMutableArray. It is working fine. Now my doubt is: In iMessage app they set that when the user hold the bubble they making the text as selectable and showing Copy option . In my app when the user hold a

renderInContext taxes App Memory

自作多情 提交于 2019-12-22 08:07:29
问题 I'm running this code on a 2448 X 2448 pixel Image. fullScaleView is also 2448 X 2448 ( fullScreenView Rect:{{0, 0}, {2448, 2448}} ). The App memory jumps from 49.7MB to 240MB down to 172MB after the method is complete. It stays at 172MB. It doesn't seem like the app should still be running at such high a memory footprint after this one renderInContext . Where and how should I force a release? (iOS 7 XCode 5 ARC). UIGraphicsBeginImageContextWithOptions(fullScaleView.bounds.size, fullScaleView

iOS - can stretch a UIImageView but not a UIButton?

☆樱花仙子☆ 提交于 2019-12-22 08:00:42
问题 Behold: //UIImageView* stretchTest = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]]; //[self addSubview:stretchTest]; UIButton *stretchTest = [UIButton buttonWithType:UIButtonTypeCustom]; [stretchTest setFrame:CGRectMake(0, 0, 400, 100)]; [stretchTest setBackgroundImage:[UIImage imageNamed:@"image.png"] forState:UIControlStateNormal]; [self addSubview:stretchTest]; stretchTest.contentStretch = CGRectMake(0.5, 0.5, 0, 0); stretchTest.contentMode =

UIScrollView with background image

a 夏天 提交于 2019-12-22 06:11:24
问题 I want to have a background image behind a UIScrollView area. That part's easy. The issue I'm running into is I don't want the image to move. I want it to fill the screen and then the scrolling just happens over that without effecting the image in anyway. I've looked through lots of other postings on similar topics, but can't seem to get anything to work. When I do the following, the background scrolls: CGRect fullScreenRect = [[UIScreen mainScreen] applicationFrame]; UISCrollView *scrollView

UIScrollView with background image

自古美人都是妖i 提交于 2019-12-22 06:10:05
问题 I want to have a background image behind a UIScrollView area. That part's easy. The issue I'm running into is I don't want the image to move. I want it to fill the screen and then the scrolling just happens over that without effecting the image in anyway. I've looked through lots of other postings on similar topics, but can't seem to get anything to work. When I do the following, the background scrolls: CGRect fullScreenRect = [[UIScreen mainScreen] applicationFrame]; UISCrollView *scrollView

Setting UIImageView image affects layout constraints

蓝咒 提交于 2019-12-22 05:26:25
问题 I am creation a simple UIImageView with the following constraints: self.view.addConstraint(imageView.topAnchor.constraint(equalTo: contentLayoutGuide.topAnchor)) self.view.addConstraint(imageView.centerXAnchor.constraint(equalTo: contentLayoutGuide.centerXAnchor)) self.view.addConstraint(imageView.heightAnchor.constraint(equalTo: contentLayoutGuide.heightAnchor)) self.view.addConstraint(imageView.widthAnchor.constraint(equalTo: contentLayoutGuide.heightAnchor)) The important one is the last