uiimageview

iPhone SDK:Trouble Dragging a UIImageView

孤人 提交于 2019-12-06 02:15:20
问题 I am trying to drag a UIImageView around the iphone screen in my app. Currently The drag functionality I have set up is fine and dragging the image does move it around the screen, the trouble is that you don't have to drag the image view to move it, you can also drag anywhere on the screen and it will move the image. I am new to this platform so I can't really think about what to do to solve this issue. My current code to drag the image is: - (void) touchesBegan:(NSSet*)touches withEvent:

UIButtons over a UIImageView Zooming

落花浮王杯 提交于 2019-12-06 02:10:23
hey guys, this is my first time post here, and im pretty new to iphone programming. i just started about a month ago and have only been tinkering with small tutorial type applications but anyways, heres my question i currently have a UIScrollView thats scrollable and zoomable, that loads a UIImageView subview, and i want to add in some controls(UIButtons) over the image view but when i zoom in and out the whole group(the buttons and the image) zoom togeather. if i add the UIButtons to my UIScrollView and zoom, the image zooms and the buttons stay in origional place if i add the UIButtons to my

iOS UIImage being rotated when after going through CIFilter

只愿长相守 提交于 2019-12-06 02:07:47
I'm working with filtering images that I'm taking with the camera. I pass the image I get from the camera through the below method. Which I have the returned UIImage sent to a UIImageView . For some reason when it passes through this method the image is getting rotated. What am I doing wrong? - (UIImage *) applyFilterToImage:(UIImage *)image withFilter:(NSString *)filterName { beginImage = [[[CIImage alloc] initWithImage:image] autorelease]; context = [CIContext contextWithOptions:nil]; filter = [CIFilter filterWithName:@"CISepiaTone" keysAndValues:kCIInputImageKey, beginImage, @

Add UILabel Under UICollectionView Cell

删除回忆录丶 提交于 2019-12-06 01:37:31
问题 I have a UICollectionView that shows images, similar to cover art, or iBooks. I would like for it to show the title of the audio clip underneath the UIImageView. I have in my MainWindow.xib a View Controller with a UICollectionView inside it. I also built a NibCell.xib for the cell itself. In the Cell, I have a UIImageView that fills up all but the bottom 30 px of the cell. In this area I add a UILabel. I give the UIImageView a tag of 100 and UILabel a tag of 200, and in my code I put: -

UIScrollview bounce and zoom with fixed top

别等时光非礼了梦想. 提交于 2019-12-06 01:22:55
Trying to make UIImageView scale when the scrollview is bouncing down. The idea was stolen from this dribbble: https://dribbble.com/shots/3341878-Product-Page As you can see, image is like'a scaling when the scrollview is bouncing down. In my app I have the UIImageView inside the UIScrollview, I can't understand how to fix the top of the UIImageView while the UIScrolvview is bouncing down. Here is what I want to do: Apply a scale transform to your imageView based on your scrollview's offsets: extension ViewController: UIScrollViewDelegate { public func scrollViewDidScroll(_ scrollView:

change position of the UIImageView

匆匆过客 提交于 2019-12-06 01:17:52
问题 How can I do a simple position changing for UIImageView. Lets say that current coordinates are x: 20 and y:30 I want to move it to x:100 and y:100. Is it possible to do animation of movement? 回答1: You need to change the CGFrame of that UIImageView Like so - [imageView setFrame:CGRectMake(100, 100, imageView.frame.size.width, imageView.frame.size.height)]; This changes the uiimageview poistion to (100, 100) while keeping the height and width same. Note that you can use the above code to not

Scaling UIImageView to fit width with AutoLayout

霸气de小男生 提交于 2019-12-06 00:58:48
I have a UIImageView on top of a UIScrollView, and I would like it to fit the device width, its height then being automatically set so that the image ratio is preserved. I am using Auto Layout, so I used constraints to bind the UIImageView to the top, left and right edges of the screen. My problem is, the UIImageView automatically resizes its frame to fit the UIImage height. And I cannot really change this frame afterwards, as it lets a gap between the UIImageView and the other UI elements, that are supposed to be just under it. I found a workaround by manually resizing the image to the good

Animate a UIImageView from center of the UIImageView

巧了我就是萌 提交于 2019-12-05 23:37:41
I have a UIImageView that should animate from size (0,0) --> (93,75) I have the following [UIView animateWithDuration:0.5 delay:0 options:UIViewAnimationOptionTransitionNone animations:^{ imgButton.layer.anchorPoint = CGPointMake(imgButton.bounds.size.width/2, imgButton.bounds.size.height/2); CGRect btnFrame = imgButton.frame; btnFrame.size.width = 105; btnFrame.size.height = 85; imgButton.frame = btnFrame; } completion:^(BOOL finished) { [self animageButton2:imgButton]; }]; This is working but the only problem I have is that it is not animating from the center of the UIImageView but from the

Is there any reason why we don't use subclasses of UIImageView?

∥☆過路亽.° 提交于 2019-12-05 22:31:27
I'm currently trying to create a subclass of UIImageView in order to make it download its image from server asynchronously ;) I tried to do it by myself but I haven't gone very far yet :D Anyway, I looked around here and found this : AsyncImageDownload I had a look at the code and the first which springs to mind is : why subclassing a UIView and not a UIImageView ?!? Any thoughts ? Cheers mates, Gotye. Nir Levy The reason it is subclassing UIView is so that you should, for example, display a UIActivityIndicator while the image is being downloaded. They do not show this in their example but I

viewDidLayoutSubviews called after touchesBegan - again and again

喜你入骨 提交于 2019-12-05 21:59:03
In an iPhone word game I have an UIScrollView (holding UIImageView ) and 7 draggable custom UIView s placed initially at the bottom (and outside the scroll view): In the single ViewController.m I have overwritten viewDidLayoutSubviews so that it always sets the zoomScale of the scroll view - to have the UIImageView fill exactly 100% of the screen width. This works well - for portrait and landscape modes. And when the app is just started: My problem is however, when I first pinch/zoom/double-tap the scroll view and then move one of the seven Tile.m views: Suddenly (not every time)