uiscrollview

UIScrollView moves image to the top left corner when zooming in

我们两清 提交于 2019-12-23 03:41:01
问题 Looking at this question: Prevent UIScrollView from moving contents to top-left, i'm having the exact issue. I'm using this tutorial: http://cocoadevblog.heroku.com/iphone-tutorial-uiimage-with-zooming-tapping-rotation Back to the similar question, if i disable the UIScrollViewPanGestureRecognizer, i'm not able to pan the zoomed image anymore. I have a UIImageView within a UIScrollView, and i want to be able to zoom and pan the image as well. How can i do tho disable the contents moving to

Core Text paragraph inside a UIScrollView is blurry

旧巷老猫 提交于 2019-12-23 03:22:16
问题 I tried drawing a long paragraph as an NSAttributedString in a view inside a UIScrollView. Weird thing is, the top of the paragraph is not blurry, but the more I scroll to the bottom the blurrier it gets ! I am well aware of the small issues you can have with Quartz and floats, therefore I tried to set the frame of the view 0.5 points below. Now the top of my paragraph is blurry, and the bottom is OK (!) I really don't know how to fix this, and would appreciate any help ! Thank you ! 回答1:

How to get rid of safeAreaInsets on UIScrollview (iOS 11, iPhoneX)

给你一囗甜甜゛ 提交于 2019-12-23 03:19:39
问题 I have a horizontal paging UIScrollview , following is my VFL constraints for leading/trailing H:|-0-[ScrollView]-0-| (aligned to superview). I have left/right safeAreaInsets on landscape orientation in iPhone X. Is it a bug? or I am missing any Apple way that these insets will not be applied when we do not need? 回答1: I am using following to skip content inset adjustment: UIScrollview.contentInsetAdjustmentBehavior = .never I found that in iOS 11 UIScrollViewContentInsetAdjustmentBehavior

How do I reset (i.e. un-zoom) a UIScrollView?

旧街凉风 提交于 2019-12-23 03:09:43
问题 I have a UIScrollView that contains an image and a segmented control that allows the user to switch the image inside of the ScrollView. If I just swap the image out inside of the UIImageView, it will display the new image in the zoomed-in state. How do I reset the UIScrollView back to its un-zoomed-in state? 回答1: I have a detailed discussion of how (and why) UIScrollView zooming works at github.com/andreyvit/ScrollingMadness/. (The link also contains a description of how to programmatically

Is it Possible to Center Content in a UIScrollView Like Apple's Photos App?

岁酱吖の 提交于 2019-12-23 02:57:23
问题 I have been struggling with this problem for some time and there seems to be no clear answer. Please let me know if anyone has figured this out. I want to display a photo in a UIScrollView that is centered on the screen (the image may be in portrait or landscape orientation). I want to be able to zoom and pan the image only to the edge of the image as in the photos app. I've tried altering the contentInset in the viewDidEndZooming method and that sort of does the trick, but there's several

How change font size dynamically when scrollView contentOffset y changed?

混江龙づ霸主 提交于 2019-12-23 02:32:36
问题 I have UIScrollView and UILabel . I want to change UILabel size dynamically from 33.0 to 0.0 , 0.0 to 33 when user scroll up / down my UIScrollView . How can I do this? @IBOutlet weak var myLabel : UILabel! override func viewDidLoad() { super.viewDidLoad() scrollView.delegate = self } func scrollViewDidScroll(_ scrollView: UIScrollView) { let offset = scrollView.contentOffset.y let fontpointmath = (myLabel.font.pointSize / (offset / 100) - 15) if offset > 0 { if fontpointmath < 0 { myLabel

Animation in UIScrollView iOS app

柔情痞子 提交于 2019-12-23 02:19:07
问题 I'm developing an iOS app and i have a full screen UIScrollView with a UIImageView at the top and 2 UIButton in the bottom. When the user scrolls i want to insert an animation on the image view (maybe only change the alpha parameter gradually). The animation is correlated with the scrollview, for example, if the user scrolls the scrollview half, will be displayed only half animation. I hope I explained myself. How can i do this? 回答1: Use the UIScrollViewDelegate scrollViewDidScroll: method.

pinch to zoom using uiscrollview

江枫思渺然 提交于 2019-12-23 02:18:31
问题 I am trying to do a pinch to zoom with a uiscrollview that only has a backgroudnd image. First of all is this possible? Secondly can I do this with interface builder? Basicly all I have atm is this - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; scrollView.backgroundColor = [UIColor blackColor]; scrollView.delegate = self; scrollView

iOS - UIScrollView can scroll but cannot zoom

你说的曾经没有我的故事 提交于 2019-12-23 02:17:29
问题 I want to zoom in/out UIScrollView that contains a UIImageView . With my code below I am only able to scroll the scroll view contents but cannot zoom it. My view hierarchy looks like this: - (UIView *) containerView -- (UIView *) contentView --- (UIScrollView *) scrollView ---- (UIImageView *) self.imageView Code: UIView *previousContentView = nil; for (NSInteger i = 0; i < 2; i++) { contentView = [self addRandomColoredView]; [containerView addSubview:contentView]; [containerView.topAnchor

Lvalue required as left operand of assignment

空扰寡人 提交于 2019-12-23 02:02:17
问题 I want to assign suitSize to scrollButton what I'm doing wrong? UIView *scrollButton = [suitScrollView viewWithTag:1]; CGSize suitSize =CGSizeMake(10.0f,10.0f); (UIButton *)scrollButton.frame.size=suitSize; 回答1: frame is a property, not a structure field. You can't assign to a subfield of it. Think of it as a function call; dot syntax for properties is convenience. This: scrollButton.frame.size = suitSize; Is equivalent to: [scrollButton frame].size = suitSize; Which doesn't work; it doesn't