uiscrollview

Vector like drawing for zoomable UIScrollView

别等时光非礼了梦想. 提交于 2019-12-18 02:54:15
问题 I have a zoomable UIScrollView with some CATextLayer s and simple CALayer s in it. They get rendered fine but the problem is when they are zoomed they become blurry. (Even if I redraw them) What would be my options to get my text not blurry when the view is zoomed? Should I use another thing? enable something in CATextLayer / CALayer ? Any idea is welcomed ;) I am using CALayer s because, as suggested in documentation, CALayer s are lighter than UIViews and I have hundreds of them. Currently

In Swift, how do I have a UIScrollView subclass that has an internal and external delegate?

﹥>﹥吖頭↗ 提交于 2019-12-17 23:14:59
问题 I'm subclassing UIScrollView to add some features such as double tap to zoom and an image property for gallery purposes. But in order to do the image part my subclass has to be its own delegate and implement the viewForZoomingInScrollView . But then when someone uses my scroll view subclass, they might like to get delegate notifications as well to see scrollViewDidScroll or what have you. In Swift, how do I get both of these? 回答1: Here is a Swift version of this pattern: Although

Parallax effect with UIScrollView subviews

自闭症网瘾萝莉.ら 提交于 2019-12-17 22:43:19
问题 I'm trying to create a Parallax effect on a UIView inside a UIScrollView. The effect seems to work, but not so well. First i add two UIView sub-views to a UIScrollView and set the UIScrollViews contentSize. The Views sum up and create a contentSize of {320, 1000}. Then I implemented the following in scrollViewDidScroll: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat offsetY = scrollView.contentOffset.y; CGFloat percentage = offsetY / scrollView.contentSize.height; NSLog(@

contentsize and contentOffset equivalent in NSScroll view

爱⌒轻易说出口 提交于 2019-12-17 22:34:18
问题 I am porting an app from Ipad to mac. (I know that it sounds weird) I stuck with NSScrollview. Please guide me contentsize , contentOffset equivalent in NSScrollview. 回答1: UIScrollView* uiScroll; uiScroll.contentSize; uiScroll.contentOffset; uiScroll.contentSize = CGSizeMake(w,h); uiScroll.contentOffset = CGPointMake(x,y); = NSScrollView* nsScroll; nsScroll.documentView.frame.size; nsScroll.documentVisibleRect.origin; nsScroll.documentView.frameSize = NSMakeSize(w,h); [nsScroll.documentView

UIScrollView wrong offset with Auto Layout

人走茶凉 提交于 2019-12-17 22:30:28
问题 I have a fairly simple view configuration: A UIViewController , with a child UIScrollView and a UIImageView in this UIScrollView . I set the UIImageView with a height sufficient to break out of the visible area (ie. higher to 1024pt ), and set the Bottom space to superview constraint of my UIImageView to a fixed positive value ( 20 for example). The whole setup works as expected, the image scrolls nicely in its parent. Except when the view is scrolled (the effect is more visible if you

UIScrollview delaysContentTouches issue

人盡茶涼 提交于 2019-12-17 22:14:33
问题 I have UIScrollView loaded with UIButtons and on UIButton action I have highlighted UIImage of each UIButton . If I don't set delaysContentTouches as NO then highlighted UIImage of UIButton will not shown if I touch up UIButton very fast. After I set delaysContentTouches property as NO then only UIButton highlighted UIImage is shown. Now after setting delaysContentTouches property as NO for UIScrollView . I can not scroll my UIScrollView by dragging on the UIButtons . Now how can I resolve

Tell When a UIPageViewController is Scrolling (for Parallax Scrolling of an Image)

巧了我就是萌 提交于 2019-12-17 21:56:11
问题 I am trying to make an effect similar to that found in the new Yahoo weather app. Basically, each page in the UIPageViewController has a background image, and when scrolling through the page view, the Image's location only scrolls about half the speed. How would I do that? I thought I could use some sort of Delegate Method in the UIPageViewController to get the current offset and then update the images like that. The only problem is that I cannot find anyway to tell if the

UICollectionView snap onto cell when scrolling horizontally

 ̄綄美尐妖づ 提交于 2019-12-17 21:39:23
问题 I know some people have asked this question before but they were all about UITableViews or UIScrollViews and I couldn't get the accepted solution to work for me. What I would like is the snapping effect when scrolling through my UICollectionView horizontally - much like what happens in the iOS AppStore. iOS 9+ is my target build so please look at the UIKit changes before answering this. Thanks. 回答1: While originally I was using Objective-C, I since switched so Swift and the original accepted

UICollectionView snap onto cell when scrolling horizontally

前提是你 提交于 2019-12-17 21:27:55
问题 I know some people have asked this question before but they were all about UITableViews or UIScrollViews and I couldn't get the accepted solution to work for me. What I would like is the snapping effect when scrolling through my UICollectionView horizontally - much like what happens in the iOS AppStore. iOS 9+ is my target build so please look at the UIKit changes before answering this. Thanks. 回答1: While originally I was using Objective-C, I since switched so Swift and the original accepted

UIView. How do I constrain scaling to one dimension only

≡放荡痞女 提交于 2019-12-17 19:26:27
问题 I have an instance of UIScrollview containing an instance of UIView. The UIView is just a container for a horizonal array of UIImageView instances. - Zooming is provided by UIScrollView and UIScrollViewDelegate. I would like to constrain zooming to occur only along the horizontal axis with no vertical scalling at all. How to I do this? Is there a way, for example, to subclass UIView and override the appropriate method to prevent vertical scaling? I like this approach but I am unclear on which