uiscrollview

UIScrollView doesn't remember the position

一曲冷凌霜 提交于 2019-12-22 09:28:15
问题 Has anyone ever had the problem that a UIScrollView , which gets moved by [UIScrollView setContentOffset:...] doesn't "remember" it's new position? It however does, if the user scrolls via touch-and-drag. Symptoms: If the UIScrollView doesn't remember the new position, it "flips" back to the original position it last remembers (which is the position which has been used via touch-and-drag) whenever it's being touched. Interesting: This only happens in 4.0 and didn't happen in 3.1 This only

Swift UIScrollView : keyboard doesn't dismiss interactively

[亡魂溺海] 提交于 2019-12-22 09:13:32
问题 I want to dismiss the keyboard interactively, but my code is not working. I don't know why. When I try the keyboard dismiss mode onDrag it is working fine and there is no need of any more code for that. Here is my code : import UIKit class LoginViewController: UIViewController, UITextFieldDelegate{ @IBOutlet weak var txtUserName: UITextField! @IBOutlet weak var txtPassword: UITextField! @IBOutlet weak var scrollView: UIScrollView! override func viewDidLoad() { super.viewDidLoad() self

How to add multiple UIImageViews to paging UIScrollView?

徘徊边缘 提交于 2019-12-22 09:09:09
问题 I have a UIScrollView with paging enabled with multiple subviews on the page: a UIButton, UIwebview and UIImageView. Both the webview and the image change on every page. This works fine. I used Apples scrolling image paging example to get me started. But when I add a second UIImageView, the position of image I have in place already gets the new values and the new image doesn't display. This is the code inside viewdidload for the first image (works fine): // load all the images from our bundle

iOS Scroll View, Container View - auto layout issue

荒凉一梦 提交于 2019-12-22 08:49:45
问题 I'm using storyboards & auto layout. I have a Container View in a UIScrollView. The Container View allows me to layout a long (320, 1000) view in the storyboard. I set the content size of the UIScrollView to (320,1000). I pinned the following constraints on the ContainerView to the ScrollView: Width Equals: 320 Height Equals: 1,000 Top Space to: Superview Align Center X to: Superview Xcode insists on adding an additional Constraint. It adds a Bottom Space to: Superview Equals: -432 . It will

Unable to insert UIScrollView above UIView to another scene using XCode 8

大兔子大兔子 提交于 2019-12-22 08:28:47
问题 I have an existing iPad app (Portrait mode) where I am trying to add Landscape mode in XCode. I have been able to do it on the first simple view, seen below by changing the class in XCode to UIScrollView and the UIView fell into line below it (I believe the UIView was added by XCode, but not sure tho'). The scrollview works perfectly when in landscape mode. When I try to do the same thing to the next scene, it won't allow me to change the order again, as seen in the following image; I'm not

ScrollView in SpriteKit

你。 提交于 2019-12-22 08:28:45
问题 I have found a few other questions and answers similar to this, but none of them quite work perfect for me. My vision is to have a horizontal scrollable view at the bottom of the screen where I can scroll through what will look like cards in a hand. Ideally, I could eventually make the card in the middle scaled up a bit and give it a highlighted look to show the user which card is selected. Even better would be if I could figure out how to keep the scroll view resizing to fir the number of

UIScrollView behavior is different in iOS8

旧街凉风 提交于 2019-12-22 08:15:24
问题 I have the following layout So it's basically a scroll view that occupies whole screen. Content size is set to triple-width and same height. Inside the scroll view - there is container view and three table views - one per page. Only middle table view is visible initially. This allows me to use scroll view horizontal scrolling to navigate between the tables and vertical scrolling inside the middle table. I know that Apple doesn't really recommend putting UITableView inside UIScrollView, but in

iOS: How sync two UIScrollview

自作多情 提交于 2019-12-22 08:13:13
问题 I have two horizontal UIScrollview s. I want to synchronise their scrolling when user drag fingers in either of them. Here is my code: self.topScrollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; self.topScrollView.delegate = self; self.topScrollView.bounces = YES; self.bottomScrollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; self.bottomScrollView.delegate = self; self.bottomScrollView.bounces = YES; ... - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { if

Animation stops when scrolling in UIScrollView

六月ゝ 毕业季﹏ 提交于 2019-12-22 06:57:14
问题 So I am trying to make a game where the user must scroll down as fast as they can in order to escape a "block" that grows infinitely bigger. Here is my problem: I am using a UI ScrollView as my mechanism for scrolling with a normal UI View as a subview. I have a time set to fire every 0.005 seconds that increases the height of both the "block" and the content height of the scroll view (so that the user can technically scroll infinitely). The problem is that whenever the user begins to scroll,

Swift: How to set UIScrollView contentSize height to height of contents?

こ雲淡風輕ζ 提交于 2019-12-22 06:25:10
问题 I have a UIScrollView. Right now I am just setting it to double the height of the screen (frame in this case is just UIScreen.mainScreen().bounds ): class VenueDetailView: UIScrollView { required init?(coder aDecoder: NSCoder) { fatalError("Storyboard makes me sad.") } override init(frame: CGRect) { super.init(frame: frame) contentSize = CGSize(width: frame.width, height: frame.height*2) <---------------- backgroundColor = UIColor.greenColor() } func addBannerImage(imageUrl: NSURL) { let