uiimageview

How can I assign a different UIImage in each UITableViewCell?

五迷三道 提交于 2019-12-12 03:39:24
问题 I am struggling to figure out how exactly I can display a different image in each UITableViewCell. I currently have a UIImageView in an expanding / collapsing UITableViewCell in my storyboard. I can assign an image to them all by defining the image in the attributes for this UIImageView but that shows the same image in each cell (obviously). This is the code I have for TableViewController: import UIKit let cellID = "cell" class TableViewController: UITableViewController { var

IOS UIImage of launch image for current device

点点圈 提交于 2019-12-12 03:12:14
问题 is there way to get launch image as UIImage for current device? or UIImageView with an image 回答1: You just need to get Default.png which will have any @2x applied as necessary. - (UIImage *)splashImage { return [UIImage imageNamed:@"Default.png"]; } If you care about getting the iPhone 5 specific one you need to do a height check: - (UIImage *)splashImage { if ([[UIScreen mainScreen] bounds].size.height == 568.0){ return [UIImage imageNamed:@"Default-568h.png"]; } else { return [UIImage

Correctly implement the blocks in the drawing view

痴心易碎 提交于 2019-12-12 03:08:02
问题 How to correctly implement the blocks in the drawing view, so that when they could cut the line in two parts. Using UIImageView or UIImage? After the cut blocks should fall under the influence of physics. 回答1: First, how many cuts could happen in total? How many independent pieces of block could result? 10? 100? Before implementing any of these, test moving that number of objects around on an iPhone or iPod touch. Just because it works on the simulator does not mean it will be fast enough on

IOS Show image in textView inside tableViewCell

浪尽此生 提交于 2019-12-12 02:58:19
问题 I got 2 images from document folder. I used this code to get 2 images from document folder: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *myPath = [paths objectAtIndex:0]; NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray *directoryContents = [fileManager contentsOfDirectoryAtPath:myPath error:nil]; NSMutableArray *subpredicates = [NSMutableArray array]; [subpredicates addObject:[NSPredicate predicateWithFormat:@

Change width to a IBOutlet (UIImageView)

我们两清 提交于 2019-12-12 02:46:36
问题 I was doing some experiments with Xcode an a little question comes to my mind: that is how I could change size of an UIImage created by storyboard. below the code I used: @IBOutlet var label: UILabel! @IBOutlet var img: UIImageView!//x=0, y=0, w=50, h=50, red, created in the storyboard var numero = 11 override func viewDidLoad() { super.viewDidLoad() if numero < 10 { label.text = "\(numero)" img.backgroundColor = UIColor.blueColor() } else if numero > 10 { label.text = "\(numero)" img.frame =

Crop UIImage with Core Graphics and Layer Mask [duplicate]

守給你的承諾、 提交于 2019-12-12 02:46:11
问题 This question already has answers here : UIImage with transparent rounded corners (5 answers) Closed 4 years ago . I have been following this SO question to crop an UIImageView that is connected with IBOutlet with a Layer Mask, here is the question and answer I was following How to crop image inside the circle in UIImageView in iOS. But now I am wondering how this could be done without have a UIImageView shown to the user. (So one that is not connected to IBOutlet). I commented on the post

Add 4 image in imageview and change the picture with tap or swipe gesture [closed]

会有一股神秘感。 提交于 2019-12-12 02:36:41
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I want to add four image in image view. at first one image will be visible. And whenever tap or swipe on image view it will change the image. i want to change the image of imageview 4 times one by one. 回答1:

Cannot determine when UIImageView frames are equal

大城市里の小女人 提交于 2019-12-12 02:15:35
问题 I have two layers. The bottom layer consists of hidden UIImageView s, the upper layer consists of visible UIImageView s. When all the frames of the bottom layer UIImageView s are equal to the frames of the upper layer UIImageView s, you have to see that in a NSLog . The problem is that the boolean method which is called by a NSTimer always returns true immediately, so I see the NSLog . I only want to see the NSLog when all corresponding frames are equal to each other. This is my code: - (void

How to save image with transparent stroke

不问归期 提交于 2019-12-12 01:48:24
问题 I followed @Rob answer and its drawn as I want...but when I saved this image....stroke not transparent anymore Objective-C How to avoid drawing on same color image having stroke color of UIBezierPath For save image I written this code -(void)saveImage { UIGraphicsBeginImageContextWithOptions(self.upperImageView.bounds.size, NO, 0); if ([self.upperImageView respondsToSelector:@selector(drawViewHierarchyInRect:afterScreenUpdates:)]) [self.upperImageView drawViewHierarchyInRect:self

UIImageView not responding to centering

爱⌒轻易说出口 提交于 2019-12-12 01:47:38
问题 I'm trying to put together a simple compass for iOS. The rotation animation seems to rotate the compass image around the center of the screen so I am trying to automatically center the UIImageView of compass Image so that it will work on different devices. And this is where my problem is. I have attempted to center the image with the following code within ViewDidLoad but with no result: compassImage.center = CGPointMake(CGRectGetMidX(self.view.frame), CGRectGetMidY(self.view.frame)); I have