uiimageview

Corner radius image Swift

我与影子孤独终老i 提交于 2019-12-04 11:45:12
I'm trying to make this corner radius image...it's not exactly the same shape of the image..any easy answer instead of trying random numbers of width and height ? thanks alot let rectShape = CAShapeLayer() rectShape.bounds = self.mainImg.frame rectShape.position = self.mainImg.center rectShape.path = UIBezierPath(roundedRect: self.mainImg.bounds, byRoundingCorners: [.bottomLeft , .bottomRight ], cornerRadii: CGSize(width: 50, height: 4)).cgPath You can use QuadCurve to get the design you want. Here is a Swift @IBDesignable class that lets you specify the image and the "height" of the rounding

iPhone Camera - Choose from Library or Take Photo

蹲街弑〆低调 提交于 2019-12-04 11:43:00
Please look at the image below !! So in this image... You can see a pop-up from the bottom which gives the user 3 options when he 'taps' the 'Camera' button. What is that view ? Is it a modal view controller which gets dismissed when an option is selected ? Edit: So it is UIActionSheet ! I have one more question on this, but StackOverflow would love it if I could edit the question rather than putting up a new one. So yes.. The option "Take Photo" uses the UIImagePickerController, and the "Cancel" button is the resignFirstResponder... What about "Choose From Library" ? How do I access the

Animated GIF does not work on iPhone

左心房为你撑大大i 提交于 2019-12-04 11:37:44
问题 I am using cell.image = an animated gif file (cell is UITableViewCell ). However, it does not animate. Is there any way I can fix it? 回答1: UIImageView provides the necessary APIs to produce your own animations like this: UIImage *frame1 = [UIImage imageNamed:@"frame1.png"]; UIImage *frame2 = [UIImage imageNamed:@"frame2.png"]; UIImage *frame3 = [UIImage imageNamed:@"frame3.png"]; UIImage *frame4 = [UIImage imageNamed:@"frame4.png"]; UIImageView.animationImages = [[NSArray alloc]

Animating a UIImage or UIImageView?

ぃ、小莉子 提交于 2019-12-04 11:34:14
问题 I'm trying to animate an image's height (from height of 0 pixels to 480 pixels) to create the effect of the image being rendered top-down. With an UIImageView i noticed that it appears correct in the Interface Builder. But when it runs in the simulator the size (width and height) is always set to whatever the size of the image is; meaning, if I set the height of the image view to be 50% the original height, the image is still rendered in full height. I also tried do this effect with an

UICollectionView insertItemsAtIndexPaths: throws exception

亡梦爱人 提交于 2019-12-04 11:05:25
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 UICollectionView, created programmatically, is added in its place. That part also seems to be working fine.

Preview rounded image in iphone

戏子无情 提交于 2019-12-04 10:54:00
can anyone tell me how can I create an image preview inside a customized cell with the aspect of the ones loaded in the mms'. I've been trying to do it by changing values in IB and I haven't been able to. Thanks a lot! (source: iphonehelp.in ) Thanks for the three answers. Doing cell3.imageView.layer.masksToBounds = YES; cell3.imageView.layer.cornerRadius = 16; cell3.imageView.layer.borderColor = [UIColor lightGrayColor].CGColor; cell3.imageView.layer.borderWidth = 1.0; I was able to do part of what I want. However, I still can't put that "glow" look on the image. Does anybody now which

Implement UITouchDown for UIImageView

[亡魂溺海] 提交于 2019-12-04 10:52:05
问题 I know how to implement touchesBegan for UIImageView is it possible to implement UITouchDown for UIImageView ?(i know that i can use touchesBegan instead of UITouchDown but i want to implement UITouchDown ) 回答1: Use a UIButton. UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom]; [aButton setImage:someUIImage forState:UIControlStateNormal]; [aButton addTarget:self action:@selector(aMethod) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:aButton]; Alternative

Convert HTML Content to image

点点圈 提交于 2019-12-04 10:49:59
HTML Content Example : This is HTML Content.<div>This is <b>BOLD</b> text </div><div>This is <i> ITALIC </i> text</div> This is the HTML content which I want to render and place it in a UIImageView and then save this image. I tried to first render that HTML content and generated a PDF and then convert that PDF into Image but that image is of very bad result. So that's why I am finding some thing that render my HTML content and add into UIImageVIew and than I will easily save that image inside my application memory. Try this solution using label/UITextView set html text to your label. do { let

How to get Size of UIImage in Bytes in iOS 4.0+?

会有一股神秘感。 提交于 2019-12-04 10:32:27
问题 I am trying to pick an image from the photo library or from the camera. The delegate method: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo Gives me the UIImage object. I need to find the size of the image in bytes for my application. Is there any way I can get the file type of the image and also the size in the bytes? Any kind of help would be highly appreciated. Thanks in advance 回答1: Try the

How to erase part of an image as the user touches it

泪湿孤枕 提交于 2019-12-04 10:20:28
My big picture goal is to have a grey field over an image, and then as the user rubs on that grey field, it reveals the image underneath. Basically like a lottery scratcher card. I've done a bunch of searching through the docs, as well as this site, but can't find the solution. The following is just a proof of concept to test "erasing" an image based on where the user touches, but it isn't working. :( I have a UIView that detects touches, then sends the coords of the move to the UIViewController that clips the image in a UIImageView by doing the following: - (void) moveDetectedFrom:(CGPoint)