uiscrollview

Scrolling after bottom of scrollview enlarges image

梦想的初衷 提交于 2019-12-12 00:09:50
问题 I have this scrollview: This is the bottom of it: But when I try to scroll even further than the bottom, the image starts to enlarge somehow like this: Why does this happen? I don't want anything to happen when scrolling more than the bottom. 回答1: There is a workaround using which you can resolve this issue. Just uncheck all the bounce properties of scrollview to disable scrollview scrolling beyond the content. 来源: https://stackoverflow.com/questions/32563282/scrolling-after-bottom-of

Reset UIScrollView to new frame dimensions after orientation change

陌路散爱 提交于 2019-12-11 23:57:28
问题 I have an ImageZoom class that subclasses UIView and is a delgate for the UIScrollView. It's pretty straight forward. The class contains a UIScrollView which contains a UIImageView. When an instance of the class is added to a view controller the image is zoomed so that it is flush with the view. There is a method that zooms in when you double tap and zooms out when repeated. Everything works great except for when I change orientation to landscape. I can't seem to figure out how to get the

touchesEnded:withEvent: from UIScrollView First Responder

淺唱寂寞╮ 提交于 2019-12-11 23:51:39
问题 I've made a UIScrollView the first responder. I need to maintain touch events to a -touchesEnded:withEvent: method on a view behind it. I've tried using the -nextResponder method and that failed. I've tried forwarding -touchesEnded:withEvent: to the view behind it and that fails. How do I get this to work? The UIScrollView wont work unless it is the first responder or gets events some other way. Thank you for any help. Shame Apple's documentation and APIs are terrible in areas. 回答1:

Move visible images in StackView closer to leading space

你。 提交于 2019-12-11 23:46:42
问题 I have a horizontal ScrollView of 20 (110 * 130 point) UIViews contained within a StackView. Each UIView contains an image. When certain UIViews are hidden the UIView width is maintained at 110points. However, spaces are left were the hidden UIView should be. I have been practicing with a StackView of 3 UIViews and hiding the center UIView. This leaves a space in the middle... I would like the 3rd UIView to move into the 2nd UIView position (middle) and perform this for subsequent UIViews

How to display a scrollview of images in fullscreen?

假装没事ソ 提交于 2019-12-11 23:22:44
问题 I implemented a method to display a fullscreen image with a black background. I would like to adapt it for a scrollview of images. The user should be able to scroll and go to next images when it is in fullscreen mode. How can I do this? This is the code to display an UIImageView in fullscreen. It is working. - (void)setUserPictImageViewZoomed:(BOOL)zoom animated:(BOOL)animated { UIView *blackView = [self.view viewWithTag:128]; BOOL isZoomed = blackView != nil; // if our current state

UIScrollView size to match UITextView size

别来无恙 提交于 2019-12-11 23:22:07
问题 I have a UIScrollView with a block of text in a UITextView . The text could be any amount of words coming from a server. I want the scroll view to be the correct scroll size to match the size of the UITextView . What is the current practice to do this? Screenshot: 回答1: UITextView is an extension of UIScrollView . So you can get its content size using contentSize propery. 回答2: You can use something like below to get the height for your textview CGSize size = [@"Your string" sizeWithFont:

Is there any way I can scroll UITextView from other view?

强颜欢笑 提交于 2019-12-11 23:20:34
问题 I have a UITextView and a simple blank view with UIPanGestureRecognizer in it. The idea behind this was the following: I make a pan gesture in blank view, gesture recognizer detects it and scrolls the text view (by scrollToVisibleRect or smth like that). Is there any other way? I am asking because this is not resolved yet. 回答1: You can set the content offset of your textView, just like any other scrollView. Try something like this: - (void)handlePan:(UIPanGestureRecognizer *)pan { if (pan

Tableview scroll to top not going all the way

久未见 提交于 2019-12-11 23:18:55
问题 I have a navigation bar that I've manually coded to animate the frame of depending on the offset of the scrollView ( tableView ). Below is a screenshot of what it looks like unscrolled. Now after setScrollOffset:(0,0) is invoked (by scrollsToTop , not me manually - e.g. by tapping status bar), the scrollview scrolls to the top, but at the position at which there used to be no navigation bar. I can manually scroll the last 44px or so after the animation happens, but obviously thats not the

How to match labelwidth in scrollview with screenwidth with autolayout in ios

删除回忆录丶 提交于 2019-12-11 21:34:26
问题 I recently started using autolayout in my apps and reached a point, where I just don't seem to find an answer. The case is simple enough: I have a ViewController with a single scrollview inside of it. The scrollview should take up all space in both landscape and portrait mode. Within this scrollview I want to have a label, that takes enough space to show its content, but only to a maximum of the current scrollview-width (which should be no more than the screen size). the remaining text should

Cannot set contentSize of an UIScrollView created via loadView

不羁岁月 提交于 2019-12-11 21:13:09
问题 I need to set the contentSize of an UIScrollView outside of the loadView function. However when trying to do so, I have the error 'UIView' does not have a member named 'contentSize' . import UIKit class ViewController: UIViewController { override func viewDidLoad() { var bigRect = view.bounds bigRect.size.width *= CGFloat(someInt) view.contentSize = bigRect // 'UIView' does not have a member named 'contentSize' } override func loadView() { view = UIScrollView(frame: UIScreen.mainScreen()