uiimageview

Mask a view in Objective-C

岁酱吖の 提交于 2019-12-13 12:06:12
问题 In ActionScript 3 we can apply a mask of to a visual object like this: SomeVisualObject.mask = maskShapeObject; How can I achieve similar result in Objective-C ? Assume I have two UIImageView objects, I want something like this: imageView1.mask = imageView2; How can I use one UIImageView to mask, or clip the shape of, another? 回答1: CALayer *maskLayer = [CALayer layer]; UIImage *maskImage = [UIImage imageNamed:@"maskImage.png"]; maskLayer.contents = (id)maskImage.CGImage; maskLayer.bounds =

Adding navigationItem.titleView in storyboard is failing

为君一笑 提交于 2019-12-13 12:02:21
问题 I can add a titleView to my navigationItem very easily in code: UIImageView *navImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"nav_logo"]]; UIView *titleView = [[UIView alloc] initWithFrame:navImageView.frame]; [titleView addSubview:navImageView]; self.navigationItem.titleView = titleView; However, I'm trying to do this within my storyboard, and am failing miserably. Here's what I've done: Drag and drop a UIView on top of my VC's Navigation Item. Drag and drop a

Display array of Images in UIImageView

喜你入骨 提交于 2019-12-13 10:22:26
问题 array of images added into Project imaging is the UIImageView and imagg is Image choosen by user its default _imaging.image=imagg; arr = [NSArray arrayWithObjects: [UIImage imageNamed:@"1.jpg"], [UIImage imageNamed:@"2.jpeg"], [UIImage imageNamed:@"3.jpeg"], [UIImage imageNamed:@"4.jpeg"], [UIImage imageNamed:@"5.jpeg"], nil]; assume user selected third image i.e 3.jpeg i am showing the 3.jpeg in imageview. Then using two button actions respectively Next and Previous next or previous images 3

UIImage view is not showing in iOS 11…How to solve?

自闭症网瘾萝莉.ら 提交于 2019-12-13 10:21:56
问题 I have an existing project in iOS, it was working fine with till iOS 10 , After updating X-Code 9 , and run the project iOS 10 it is fine but in iOS 11 the UIImageview is not showing .. I have already tried so many ways like clean derived data, reset clean build with quit x-code and restart system, remove and add image(png file), but noting happen. Even i have added the background colour but the colour is also not showing in the device and simulator but it is in the storyboard . one more

How to prevent the pixels from becoming blurry when I enlarge an image in my color pick project for iOS?

。_饼干妹妹 提交于 2019-12-13 08:59:54
问题 I'm making a little project that provides the ability to enlarge an image and pick pixels' colors from the magnifier, now I can magnify the touched place of the image, but the magnifier shows the pixels with blurry effect, how can I make it show the pixels one by one very clearly without any fuzzy processing? - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGRect bounds = self.bounds; CGImageRef mask = [UIImage imageNamed: @"loupe-mask@2x.png"].CGImage;

IOS - multiple images going slowly upward animation

醉酒当歌 提交于 2019-12-13 07:47:14
问题 i am new to IOS programming. what i want is i want to show multiple images and then they go upward continuously and then repeat again and again in sort of a loop. how can i do this ? i have total 8 images which i want to show like this i don't know how can i add 8 images and then they go upward direction verically continuously repeating. please help me in this. if there is any tutorial related to that and then please share 回答1: You should not do it this way. If you make your step value small

In iOS, how to convert a web image into a less-quality one?

寵の児 提交于 2019-12-13 07:24:09
问题 The app downloads images from the web and shows them in a table view as thumbnails. However, the quality of these image are "too good". They are HD quality and if there are too many images in a table view, it might slow down the UI a bit. Before I set the image to a cell, how to make it "less quality"? (occupying less memory & requiring less processing power to show them) I tried something like this: let smallerImage = UIImage(CGImage: image.CGImage!, scale: 0.2, orientation: image

Infinite rotating image background UIImageView

北城以北 提交于 2019-12-13 07:17:24
问题 I'd like to extend a class from UIImageView ,which will infinite rotate a universe image. So I can simply put this image view as background view for other UI elements. 3 questions here: Is it the right way to extend from UIImageview class. How to keep rotating infinite, and as background, when put it into other views, I don't need to write extra lines of code. I wrote a rough prototype, when I put it into other views as background, all UI elements in this view are rotating with the image. 回答1

Sending Images to Several Instances of a ViewController in Swift

陌路散爱 提交于 2019-12-13 06:51:51
问题 I download several "events" from CloudKit in my program. Each one contains a picture, title, and location. The second two are used right away and there is no problem. The image is only seen if the user clicks on the info button on the annotation that shows the picture using a separate view controller. I am having trouble getting the images to be passed to the ViewController before it is used while also keeping each event's picture separate. Here is where each record is queried from CloudKit

Position an UIImageView over another with scaling

时间秒杀一切 提交于 2019-12-13 06:49:55
问题 Is there a method on UIImageView that tells me the position of its image within its bounds? Say I have an image of a car, like this: This image is 600x243, and, where the rear wheel should be, there's a hole which is 118,144,74,74 (x,y,w,h). I want to let the user see different rear wheel options, and I have a few wheel images to choose from (all square, so they are easily scaled to match the hole in the car). I wanted to place the car image in a UIImageView whose size is arbitrary based on