uiimageview

how to make UIImage as NULL in objective-c

旧城冷巷雨未停 提交于 2019-12-20 07:55:57
问题 I have used the code : UIImage *selectedImage; then, for (int j = 1 ; j <=b ; j++){ id subView = [self.view viewWithTag:j]; if ([subView isKindOfClass:[UIImageView class]]){ ((UIImageView *)subView).image = selectedImage; then how to make the UIImage as null value. 回答1: Instead of making UIImage NULL set the Image as Empty Image [UIImage imageNamed:@""] 回答2: If you want to simply set your image to null, just do : yourImage = nil; If I missunderstood the question or if I'm wrong do not

UIView background sizing issue

自古美人都是妖i 提交于 2019-12-20 07:05:27
问题 I'm adding a UIImageView to the UIViewController's UIView as I would normally, with the frame of the image view being the same as self.view to make sure that the image will cover the whole view. However, there is a roughly 20px padding between the status bar and the imageView which I can't seem to get rid of. I've tried NSLogging the different frames, and receiving the following results: NSLog(@"ImageView => %@", NSStringFromCGRect([imageView frame])); NSLog(@"self.view => %@",

UIImageView Position Resetting during label text update

吃可爱长大的小学妹 提交于 2019-12-20 06:29:49
问题 Really weird issue going on here. Using XCode6 with iOS8 I have a simple UIImageView, which moves across the screen when I click. No problem- works great. I Just have a simple method to update specific labels...based on an int called StrikesLeft. Here is my updateLabels method: -(void)displayLabels{ //update strikes label strikesLeftDisplay = [NSString stringWithFormat: @"%d", strikesLeft]; lblStrikes.text=strikesLeftDisplay; } Here is the weird issue though: If I don't actually update the

Titanium ImageView wont display images?

本秂侑毒 提交于 2019-12-20 05:38:09
问题 I created an image directory in my projects in the UI folder to place my images. So the full path is currently Resources/UI/Images. When i create an image view it wont display the images. I tried different options, even a web image but nothing works? var self = Ti.UI.createView({ backgroundColor:'white' }); var imgv = Titanium.UI.createImageView({url:"http://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Volkswagen_Logo.png/600px-Volkswagen_Logo.png"}); self.add(imgv); var imgv = Titanium

UIimageView rotate around a point

∥☆過路亽.° 提交于 2019-12-20 05:20:50
问题 I've got an image (a straight line) and am trying to rotate it in some angle from a specific point. What happens is that the image is rotated from the center point of itself. I wan't a way through which the base of the image remains the same and it rotates in the angle I want to, just as in case of a clock. I use Compass2.layer.anchorPoint= CGPointMake(0.5,1); [Compass2 setTransform:CGAffineTransformMakeRotation(XXXX)]; However it shows Accessing unknown 'achorPoint' component of a property.

Using TVPosterImage in TVUIKit for tvOS 12

会有一股神秘感。 提交于 2019-12-20 04:55:23
问题 tvOS 12 has a new framework TVUIKit, which introduces the lockup views. The class I am interested in is TVPosterView, which is basically designed as such: Swift 4.2 open class TVPosterView : TVLockupView { // One may use UIControl to implement it in iOS public init(image: UIImage?) open var image: UIImage? // default is nil open var title: String? open var subtitle: String? } In my storyboard I have added an UIView element, and rightly (at least I hope so. Yesterday the IB agent kept crashing

isAnimating return is faulty for UIImageView for iPhone

岁酱吖の 提交于 2019-12-20 04:25:17
问题 I am finding that isAnimating is returning true even after it has completed the max # of loops and stopped animating. However once you move the UIImageView, it will suddenly update and change to false. Here are the important bits of my code: I set up the animation in the standard way: UIImageView* newImageView = ... newImageView.animationImages = imageArray; newImageView.animationDuration = 1.0; newImageView.animationRepeatCount = 1; ... [newImagView startAnimating]; Elsewhere in the code I

UIImageView returning nil in a custom UICollectionViewCell

两盒软妹~` 提交于 2019-12-20 03:25:12
问题 I asked a similar question last week but I think I have it narrowed down to more specifically what is going wrong. The custom cell is being loaded and looks to be called correctly when I use the collectionView.dequeReusableCellWithIdentifier("MenuCell", forIndexPath: indexPath) as MenuCollectionViewCell "MenuCell" is the reuse identifier for my custom cell and MenuCollectionViewCell is the swift file that holds the custom code. From debugging the code I have determined that the UIImageView is

Retrieving UIImage from UIImageView in Swift

陌路散爱 提交于 2019-12-20 02:26:11
问题 I've found the solution but it is not in Swift: Converting UIImageView to UIImage I've even went rogue by trying to implement it in Swift by using UnsafeMutablePointed and had no luck. However, pointers are typically frowned upon in Swift and it would be nice if there was a simple one-liner solution to this! Example Code: let test1:UIImageView = UIImageView(image: UIImage(named: "test")) let test2 = test1.image // This fails with an error: Instance member ‘test1’ cannot be used on type

UIImageView image does not update visibly when image property is set

旧街凉风 提交于 2019-12-20 01:59:03
问题 I have a UIImageView whose user interaction is true and to which I have given a tap gesture recognizer, whose action handler is as follows: @IBAction func tap(_ sender:UITapGestureRecognizer) { let iv = sender.view as! UIImageView let im = iv.image! let im2 = UIGraphicsImageRenderer(size:im.size).image { _ in UIColor.red.setFill() UIBezierPath(rect: CGRect(origin:.zero, size:im.size)).fill() } iv.image = im2 } I expect the image displayed, when I tap the image view, to be replaced by a solid