FAQ Database Discussion Community


Using delegates: unexpectedly found nil while unwrapping an Optional value

ios,swift,uiscrollview,delegates,uiscrollviewdelegate
I have two ViewControllers, assume one is named MainVC and the other one is named GetCameraRollImageViewController. In the second one, there is a UIScrollView which holds a UIImageView, since I'm using segue to show the second view controller, I've to use its delegate in the MainVC: class ViewController: UIViewController, GetTextDelegate,...

Why my “pull down to load data” stuck at page 2 without loading anymore data

ios,uitableview,swift,uiscrollview,infinite-scroll
Is there a theory about reloading new data by appending old data with new from json?I am having problem with solving that case.I used this infinite uitableview to reload more data from my api json string.My Api give me back the results base on page no. My json header include...

UIScrollView “out of frame” touch areas don't respond

ios,objective-c,iphone,uiscrollview,uikit
I'm creating a UIScrollView as say (320, 320), at origin (0, 400). Assuming for now I'm designing for an iPhone 5S, with 568pts of height. This means the bottom portion of my scrollView does not appear in the ViewController's view as its too tall. Later, I shift my entire ViewController...

Frame in screen on UIView who is in UIScrollview

ios,uiview,uiscrollview
I would to know if there are an easy way to get the frame in the main screen of a UIView who is in a UIScrollview. Like - rectForRowAtIndexPath: in a UITableView....

UI scrollview Inverted Text Colours

ios,uiscrollview,invert
(iOS) I'm looking for a way to invert the colours of text once the UIScrollView in has passed over it - if it's even possible. For example, if you have white text elements and the scroll view is also white-coloured, is there a way for the text turn black once...

Swift UIScrollView : keyboard doesn't dismiss interactively

ios,swift,uiscrollview
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,...

UITableViewCell get deleted directly by tapping delete control on the left but not show delete button on the right

ios,uitableview,uiscrollview,delete,edit
When I involve [tableView setEditing:YES animated:YES], delete control shows on every cell on the left,what I want to do is to get the event when I tap delete control,and directly delete cell but not to show delete button on the right. I know apple's standard way to do this is...

How to detect when UIView size is changed in swift ios xcode?

ios,swift,cocoa-touch,uiview,uiscrollview
I am trying some stuffs out with CATiledLayer inside UIScrollView. Somehow, the size of UIView inside the UIScrollView gets changed to a large number. I need to find out exactly what is causing this resize. Is there a way to detect when the size of UIView(either frame, bounds) or the...

How to get rid of the scrollview scroll contentsize in IOS?

ios,objective-c,iphone,uiscrollview,contentsize
I had created scroll view programmatically and set all the content size and frame properly. Though it is creating a problem in iPhone 4 and 4s. In iPhone 5 it is working fine .... Look at the attached images.... viewFirst = [[UIView alloc]initWithFrame:CGRectMake(10, objScrollView.frame.origin.y+30, 30, objScrollView.frame.size.height-30)]; UIScrollView *scrollViewFirst = [[UIScrollView...

Allow scrolling image up and down in UIScrollView

ios,objective-c,uiscrollview,uiimageview
I have a UIImageView inside a UIScrollView, I also implemented this method: - (UIView*)viewForZoomingInScrollView:(UIScrollView *)scrollView { return self.imageView; } For the image to resize inside the UIScrollView, but I want to allow the user to change the y axis of the image and move it up and down, not just...

Image overlaps previous view when tapping/swiping back

ios,swift,uiscrollview,uiimageview
I have a UIScrollView which covers one of my views entirely. I have added a background image to this same view which scrolls at a slightly different rate to the actual UIScrollView. This works absolutely fine unless I use the back swipe gesture or tap the 'Back' button. What happens...

Xcode UIScrollView zoom same as MKMapView zoom (no effect on subview)

ios,objective-c,uiscrollview,mkmapview,zoom
I want to add zoom effect on my UIScrollView . That i have achieved it with UIScrollView delegate methods. (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView. Now i want to add the effect that MKMapView is having in it, that if we zoom-in or zoom-out the MKMapView place marker of the map remains at...

how can i get the height of UILabel?

ios,uiscrollview,autolayout
hello everyone, Here i took one UIView and UIScrollview from storyboard and set its constraint from storyboard and i have created one UILabel programmatically inside of UIView and set its constraint. Now my problem is how can i get the height of UILabel? so based on its height i want...

iOS: The proper way to display Images and long texts with scroll functionality

ios,objective-c,uiscrollview
I'm developing an app for a news website, i'm displaying the news articles using UITableView where each cell is an article title, when a user clicks on a cell (i.e an article), another view opens (using segue), now in this view i want to put the following: The article's Image...

tapGestureRecognizer not firing action when on a UIScrollView Swift

ios,swift,uiscrollview,uitextfield
I have a ViewController that has a UIScrollView and the keyboard wont dismiss when using a tapGestureRecognizer. The action wont even fire. Normally this works fine on other ViewControllers that I have built. I think the UIScrollView is eating up all the touch events. I know you can set the...

strange behaviour with UINavigationController and autolayout top layout guide

ios,layout,uiscrollview,uinavigationcontroller,autolayout
I am using auto layout for a controller under navigation controller. For this controller, I mainly have a scroll view inside the controller's view. the alignment rule for the scroll view is top layout guide, bottom layout guide, leading aligned with super view and trailing as well. the layout is...

UIImageViews not scaling correctly in UIScrollView with paging

ios,swift,uiscrollview,uiimageview,scroll-paging
I'm trying to build a very simple UIScrollView with several images where paging is enabled. However, I can't seen to get the images to correctly be resized to the bounds of my UIScrollView. The images are always bigger than the bounds, thus messing with my paging. I have a UIScollView...

UITextView always scrolls from the beginning when using scrollRangeToVisible()

ios,uiscrollview,uitextview
I'm debugging a UITextView which logs my operation. e.g. If I press a special button on the screen, this UITextView will show which button I just pressed. It will log more as I pressed more buttons, so I can easily scroll the UITextView to see my past operation. Because the...

Disable UIPageViewController bouncing - Swift

ios,swift,uiscrollview,uipageviewcontroller
I've been making a sample app with scrolling between UIViewControllers but the point is i want to disable the bouncing effect at the end of scrolling and when going back to the first UIViewController. here is my code : class PageViewController: UIPageViewController,UIPageViewControllerDataSource, UIPageViewControllerDelegate{ var index = 0 var identifiers: NSArray...

Losing tap recognition after adding a UIScrollView under a UIButton

ios,uiscrollview,uibutton,uikit,uitapgesturerecognizer
I have two adjacent UIScrollViews, both partially covered by a UIButton with a tap gesture recognizer. They are added to the view in this order: Scrollview #1 Button Scrollview #2 (added by user interaction) Both scrollviews are z-positioned "behind" the button, but the button does not receive taps where it...

Scroll UIScrollView on selection UITextField, can't get the right sizes

ios,swift,uiscrollview
What I've got is a UIScrollView with a containerview inside it. This has a UITableViewcontroller embedded that contains static cells. I'd like to scroll the UIScrollView when I'm selecting a UITextField inside the static cells. I tried it two ways, 1. calculating the position, 2. calculating the cell index. Both...

Key-value observing doesn't work for zoomScale

ios,objective-c,xcode,uiscrollview
I'm stuck with following problem. I have a UIScrollView, _myScrollView, and I want to have another UIScrollView following it's movements. So I'm using key-value observing for the properties "zoomScale" and "contentOffset", but the observeValueForKeyPath:ofObject:change:context: method only report changes in "contentOffset", not in "zoomScale", though the zooming workes fine. (See code...

didSelectItemAtIndexPath of UICollectionView inside of a UIScrollView is not getting called

objective-c,iphone,uiscrollview,uicollectionview
I've implemented non scrollable UICollectionView inside a UIscrollview. The size of the scrollview is 100x100 and that of collection view is 100x200; And the content size of the scroll view is 100x200. My problem is, the didSelectItemAtIndexPath is not getting called when I touch some cells (the cells out of...

Add Storyboard UITableView and custom UITableViewCells to UIScrollView programmatically

uitableview,uiscrollview,storyboard
In my Storboard, I have a UIViewController (ParentClass) -> UIScrollView (linked to Parent) -> UITableView (linked to Parent) -> UITableViewCell (2 cells, each with their own Class). What I'm trying to do is add several instances of the UITableView (with the custom cells) into the UIScrollView. I am close with...

How to prevent UIWebView scroll to top when I load a new html string?

html,ios,uiwebview,uiscrollview
I have a html string, and I load the html string to UIWebView, and the user may scroll down the UIWebView . When sometime the html string I changed ,so I call the UIWebView load the new html string. But when I load it ,the UIWebView scroll to top.The difference...

Increment Variable on horizontal UIScrollView slide

swift,variables,uiscrollview
How would I increment a variable when the user swipes to the right or left in my horizontal UIScrollView. For example; var pageNumber = 1 When the user swipes right it increments by 1 and when swipes left it decrements by 1 - Here is my scrollView code that is...

UICollectionView isn't scrolling to indexPath

ios,objective-c,uiscrollview,uicollectionview
I have a UICollectionView that I set the translatesAutoresizingMaskIntoConstraints to NO, and added some constraints. When I try scrolling it to an indexPath: [self.datesCollectionView selectItemAtIndexPath:selectedCellIndexPath animated:YES scrollPosition:UICollectionViewScrollPositionCenteredHorizontally]; Then it completely ignores that, and doesn't scroll. But when I remove translatesAutoresizingMaskIntoConstraints, then it scrolls, but the constraints are ignored. My question...

Unity - Scroll Rect?

button,unity3d,uiscrollview,scrollrect
I have this problem. I'm using a scroll rect to display a series of buttons, but I would make sure that as soon as the buttons (with the scroll rect), come out of a certain area (bounded by a panel), become invisible. to explain it better in the pictures. I...

Start UIScrollView with an image of particular index from another view

ios,swift,uiscrollview
I have a collectionView with multiple images. When tapping on one of them a new view is being opened - UIScrollView. Now every time UIScrollView starts with the first image of the array from collectionView. I am passing the index(imageNumber) of the image tapped to UIScrollView but i don't know...

iOS UIScrollView with autolayout not centering correctly

ios,objective-c,uiscrollview
After googling and searching for a solution to this I have decided just to ask a question. I am trying to setup a UIScrollView with AutoLayout being left on. I have been researching this all day and finally got the ScrollView to behave correctly with AutoLayout by putting a child...

image slider with previous and next image visible

ios,objective-c,uiscrollview,slider,image-gallery
What I have is list of images. I was showing those images in scrollview with paging enabled. Now client came back asking too show next (partly visible), current (fully visible) and previous (partly visible) images as shown in below image. What I tried is as below. int mm = 150;...

Enable scrolling when UIView is out of screen bounds

ios,swift,uiscrollview
I'm trying to enable scrolling when myView's bounds go beyond the screen's bounds. Initially myView is a CGRect of (x:0, y:0, width:320, height:10) On button press myView's height increases by 100 points. myView is a subview of scrollView. scrollView is a subview of view (The main view). The height increases...

ScrollView -> View (Label + Label + TableView) and autolayout

ios,objective-c,uiscrollview,autolayout,constraints
Inside the ScrollView are two Labels (multilateral), and below it the TableView (in which the number of rows may be different). The height of both Label and TableView is not set. All outlets set constraints on the indents from each other above and below, including a View of the container....

Scrolling a ViewController Swift

ios,swift,uiscrollview,xcode6
I am trying to make a view controller scrollable because there is not enough room on the screen at one time to fit everything. I have checked out links from Google on how to do this http://www.ongraph.com/blog/scroll-view-in-swift and http://makeapppie.com/2014/12/11/swift-swift-using-uiscrollview-with-autolayout/ The only thing is that these examples use images while I...

about UICollectionView Horizontal Paging with pure code

ios,objective-c,uiscrollview,uicollectionview,uicollectionviewcell
In order to achieve auto Horizontal scrolling, I custom a collectionView with 100 sections, and there're 5 items in every section. And then add a NSTimer, the original position is set to the middle of collectionView(the 50th sections), it works at last. (ps: the collectionView is the headerView of a...

iOS: How sync two UIScrollview

ios,objective-c,uiscrollview,uipangesturerecognizer
I have two horizontal UIScrollviews. 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 {...

UITableView Scrolls to Top on Cell Refresh

ios,objective-c,uitableview,uiscrollview,uitextview
I have a UITableView with a cell that is dynamically sized to fit a UITextView inside it. Whenever a key is typed, the cell checks to see if the calculated height has increased, as with a newline, so it can tell the table the the cell's height needs to be...

Layout constraint to resize image to screen width maintaining aspect ratio

ios,uiscrollview,autolayout,resolution,nslayoutconstraint
I have a background image which is to be the same width as the iPhone screen but longer in length. I want to scroll the image along the y axis. I have set up a scroll view and placed an image inside which works fine as I can scroll to...

UIPanGestureRecognizer conflicts with UIPinchGestureRecognizer's superview

ios,uiscrollview,uigesturerecognizer
I have a UIScrollView instance with a subview that has its own UIPanGestureRecognizer which is used to move the subview inside the scrollview. I would like the pinch-to-zoom feature of the scrollview to have the top priority over the pan gesture. However, this is not the case: when starting to...

NSFetchedResultsController does not reload data on request

ios,objective-c,uitableview,uiscrollview,nsfetchedresultscontrolle
Hopefully someone can explain to me why my NSFetchedResultsController only fetches data once. I have created a singleton with a NSFetchedResultsController method in it. My app has a UITabBarController and in one of the tabs is an UINavigationController. Inside this UINavigationController I have setup a UIScrollView with 3 tableviews, all...

How to take button at the center of the UIScrollView?

ios,objective-c,uiscrollview
I am generating multiple buttons in my scrollview, A scroll view that has constrains at main.storyboard so it's width changes on different iphones. and i can't make my buttons to the center. Here is my code. @synthesize table,scroll; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading...

TextView inside ScrollView stick to keyboard

ios,swift,uiscrollview,uitextview,uikeyboard
I have a UIScrollView and content inside it. Inside content there is a UITextView. When user presses the UITextView I want the UITextView stick to the keyboard. In the image: Whole thing is UIScrollView Bottom black area is the visible screen Red area is content Blue area is UITextView Green...

How to change UILabel height according to content in iOS

ios,objective-c,uiscrollview
I am facing a problem on dynamic Label height.My requirement is like below image: I am taking a UIScrollView and on UIScrollView I am adding UILabel for showing content. My content is different type of text size. If I set 1 content its coming perfect but if I take content...

How to call UIScrollView's delegate method when there are two scrollViews in the UIViewController

ios,objective-c,uiview,uiscrollview,uiscrollviewdelegate
When there're two scrollViews in the UIViewController, how can I call UIScrollView's delegate method, which makes it only works on one of scrollViews and never affects the another?

Nested uiscrollviews and custom handling event routing

ios,objective-c,uiscrollview
I have nested UIScrollViews in a such way that inner UIScrollView is located at second page of outer UIScrollView. (i.e. inner one's frame would be CGRectMake(320, 0, view.width, view.height)). Two scrollviews only goes horizontally. I would like to swipe only inner scroll view once it is on the screen (i.e...

making an image the full size of a scrollview

swift,uiscrollview,uiimage
I have set an image as a background in my scrollView so i can zoom in a pan around it, however, when the image is completely zoomed out it creates white borders to the left and right of the image which i can only assume is the scrollView margins. Any...

Set UIScrollView.setContentOffset without scrolling?

ios,objective-c,swift,uiscrollview
I have a UIScrollView which shows a range of different plots. I want the UIScrollView to scroll from LEFT to RIGHT, so I want to set the ContentOffset of the UIScrollView to the "end" of the ContentOffset. I do it like this, which works: var point = CGPointMake(scrollView.contentSize.width - scrollView.frame.size.width,...

How UIScrollView setContentSize works

ios,objective-c,uitableview,uiscrollview
ContentSize is the property of UIScrollView. In my UITableView subclass I implemented this - (void)setContentSize:(CGSize)contentSize { NSLog(@"contentSize = %f, %f", contentSize.width, contentSize.height); NSLog(@"self.contentSize = %f, %f", self.contentSize.width, self.contentSize.height); } From where this contentSize is coming from? and why contentSize and self.contentSize have different values?...

Add UIImageView to UIScrollView

ios,xcode,swift,uiscrollview,uiimageview
Was hoping someone could point out what is wrong with this. My storyboard has a UIScrollView named timelineScrollView and a UIImageView named imageviewtest. I am creating an image that is a simple straight line. If I add it to the UIImageView it displays fine. However if I add it to...

How to have buttons scroll with background in Swift?

ios,xcode,swift,uiscrollview,scrollview
I have an image that you can scroll through using UIScrollView. I want to add buttons to it. The buttons need to stay attached to the image and scroll with it, not separately. I need this all done programmatically. This is the code I have right now: imageView = UIImageView(image:...

Automatically set UIView vertical size based on device vertical size (including Auto Layout changes)

ios,uiview,uiscrollview,ios-autolayout
I've been googling on this and can't seem to pinpoint an answer to the question that I have. I'm writing an app and would like the vertical space of a child UIView to maintain the height of the device or rotation of the parent device regardless of orientation and without...

How to make uiscrollview only vertical scrolling for ios?

ios,objective-c,ios8,uiscrollview,autolayout
I'm trying to make layout inside scrollview using this one tutorial https://www.youtube.com/watch?v=UnQsFlMGDsI And get the following result http://youtu.be/iPfzyLbEZMA It will be appreciated for any advices or tutorial links. It needs only vertical scrolling...

UIScrollView in sprite kit

ios,objective-c,iphone,uiscrollview,sprite-kit
I am new to programming and am developing an iOS game. I have used only one view controller, which initializes the home SKScene and isn't used at all after that, and have around 6 SKScenes that can navigate between each other with the following code (in their respective scenes) SKScene...

UIScrollView and a background Image

ios,uiscrollview,uiimageview
I have a UIViewContainer having a View1-->ScrollView-->View2-->Imageview(background Image) The scrollview is placed below the top layout guide so that the screen doesnt scroll under the battery etc. Because of this the top layout guide is blank/Blue(view's color,no background image). So I added another Imageview to View1 to act as a...

ScrollView with one child and AutoLayout not scrolling

ios,objective-c,uiscrollview,autolayout
I have a ViewController setup as follows: This is a News app so everything is dynamically loaded, once I finish loading data into the Article Title, Article Content, and Image View (the Outer ScrollView) doesn't really scroll I also checked the ContentView to get its size (just debugging) it gives...

Trouble with scrollview

ios,objective-c,uiscrollview,viewcontroller
I have a strange problem with a ScrollView. I currently have 4 TextFields and 4 Labels on one ViewController, and when the keyboard pops up, it obstructs the view of 3 of the 4 pairs of TextFields and Labels. I added a ScrollView, but when I did, I was suddenly...

UIView's frame rendering larger than frame

ios,objective-c,uiview,uiscrollview
I am trying to add a subview to a UIScrollView. First I instantiate the view controller from the storyboard, then set the view's frame to the application bounds. When I add the view to the UIScrollView, it is clearly larger than it's supposed to be. CGRect mainFrame = CGRectMake(0, topButtonHeight,...

AirBnb iPad app - UITableView over image?

ios,uitableview,ipad,swift,uiscrollview
AirBnb just came out with their first ever iPad app, it's really slick. There's a UITableView over an background image (which is a UIScrollView itself). Does anyone have ideas on how to implement it? I assume it's something to do with checking scroll settings? Here's a screenshot: ...

iOS: how to display a long text in a UIScrollView?

ios,objective-c,uiscrollview,uitextview
EDITED I have a UIScrollView, it has an ImageView at the top, under that there is a UIlabel, and under that i want to put a long text. I tried to put a UITextView inside of a UIScrollView, but UITextView has its own scroll bar, i need to put a...

programmatically scroll to a specific page/position with autolayout iOS

ios,cocoa-touch,uiscrollview,autolayout
I am using autolayout with a scroll view. It is working great, but I need to be able to scroll to specific pages programmatically. Specifically, I need to scroll to the last page after the view loads. How do I do this? My scrolling essentially has the visual format shown...

Disabling touch detection UIScrollView

ios,swift,uiscrollview
I'm making a drawing app and I would like it to accept pictures that are bigger than the screen. For this, I put an image view in a scroll view. However, when the drawing tool is enabled I want to disable the detection of touch events on the scroll view...

UIScrollView top very low

ios,uiscrollview
In my storyboard I have a label and a UIScrollView subclass with the scrollview constraints placing it directly under the label: In code I am adding a single view that will have the content: let contentView = UIView(frame: CGRectMake(0, 0, 2000, 1000)) override func viewDidLoad() { contentView.backgroundColor = UIColor.whiteColor() tableView.addSubview(contentView)...

How to move up scrollview 's frame before scrolling contentView? (when scrollView starts at the middle of the screen)

ios,swift,uiscrollview,frame,contentoffset
My scrollview is at the vertical center of the screen, and a view1 is above it, at y=0. When I scroll down, the view1 is enlarged (this works fine, it creates a zoom). When I scroll up, I would like to move the scrollView up to the top of the...

Wrong alignment of subviews in a UIScrollView

ios,objective-c,swift,uiview,uiscrollview
I have the following code, which creates UIView, and some of its subViews, and adds them to a UIScrollView, all in a loop : var count:CGFloat=bookScrollView.frame.minX for var i=0;i<10;i++ { var view=UIView(frame: CGRect(x: count + 20, y: bookScrollView.frame.minY + 30, width: 200, height: 300)) view.backgroundColor=UIColor.whiteColor() view.layer.cornerRadius = 5; view.layer.masksToBounds =...

Horizontal Calendar in iOS

ios,iphone,uiscrollview,nscalendar
I have used UIDatePicker as native control and also used libraries mentioned over Stackoverflow and github. But i want to have a calendar view , horizontally scrolling days in a row like in image. Please share your ideas/logic about what are possible solutions to achieve this functionality. Thanks ...

Swift ScrollView In UITableViewCell not scrolling

ios,iphone,uitableview,swift,uiscrollview
I am new to swift and am trying to add a UIScrollview to a custom UITableViewCell. I can't seem to get the scrollview to scroll in the simulator though. I have tested both vertical and horizontal scrolling. Here is the code for my custom UITableViewCell import UIKit class CustomTableViewCell: UITableViewCell,...

Swift remove subviews from superview

ios,swift,uiscrollview,uirefreshcontrol
i have a scrollView, and i added a refreshcontroll to it. self.refreshControl = UIRefreshControl() self.refreshControl.attributedTitle = NSAttributedString(string: "Frissítéshez húzzad! :)") self.refreshControl.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged) self.scrollView.addSubview(refreshControl) in the refresh method i have to remove all subviews from the scrollview, then repopulate the scrollview.. self.refreshControl = UIRefreshControl() self.refreshControl.attributedTitle =...

image view not scrollable in scrollview and not fit properly using pure layout

ios,objective-c,uiscrollview,uiimageview,pure-layout
I'm simply trying to place an image into scroll view which is in a main view using purelayout. And what i'm taking right now is; Note that view with red background is scroll view. And also the image is not scrollable. - (void)loadView { self.view = [[UIView alloc] init]; [self.scrollView...

How to set content size of scrollview to maximum width of frame on any size device

ios,iphone,swift,uiscrollview,contentsize
I created a UIScrollview in my storyboard with any width and any height, and I am trying to set the content size width to the width of the frame on the device that it is viewed on. No matter what I try, the width is being set to the width...

Detect touch location in UIImage which is in a scrollview

ios,swift,uiscrollview,uiimageview,uitapgesturerecognizer
I have the following UI hierarchy: UIView -> UIScrollView -> UIImageView It was necessary because i wanted to zoom my image in and out. So far so good and everything works. Now i wanted to detect the touch location of the image. I've read already a lot and it works...

UILabel set framework doesn't work if the value is negative

ios,objective-c,uiscrollview,uilabel,frame
I have downloaded this project that show a small example regarding paging: Paging example project And I have added a label and by using the scrollViewDidScroll: delegate method that is called when any scrolling action takes place I call a method that resets the x position of the label aded...

Making a scroll view in Xcode 6 storyboards

ios,xcode,swift,uiscrollview,autolayout
I'm trying to make a very basic layout in a storyboard in Xcode 6 with content that is too big to fit on the screen. I'm trying to use a UIScrollView and place a view inside of it, then put what I want in there, but it isn't working properly....

Avoiding multiple Scroll when textview is used inside Scrollview ios

ios,swift,uiscrollview,uitextview
I added a textview inside a ScrollView. The problem happens when I increase the size of the textView. The first scroll happens until the end of the view. The second scroll happens in the textview for scrolling it to the end of the text. For reading the whole text the...

How to both scroll and stop UIScrollView programmatically?

ios,animation,scroll,uiscrollview,animatewithduration
There are a lot of similar questions but they all differ from this one. I have UIScrollView which I could both scroll and stop programmatically. I scroll via the following code: [UIView animateWithDuration:3 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ [self.scrollView scrollRectToVisible:newPageRect animated:NO]; }]; And I don't know how to stop it at all....

Why my image is not display immediately after downloaded?

swift,asynchronous,uiscrollview
I am having problem with async programming.I have a UIScrollView which will display multiple images(3~10) when I enter into detail view.So,there are two process that I currently working on.First,When I enter to the detail view,the post request which will call api to display detail data(images and data).Second,when I get the...

Cannot set UIScrollView to be scroll in UITableViewCell

ios,uitableview,swift,uiscrollview
I need to add a UIScrollView in a UITableView, but it does not work. I have set scrollEnabled, alwaysBounceVertical, delaysContentTouches, canCancelContentTouches, but still same. var scrolling: UIScrollView = UIScrollView(frame: CGRectMake(0,0,self.view.frame.width,50)) scrolling.userInteractionEnabled = true var style1: NSMutableParagraphStyle = NSMutableParagraphStyle() style1.lineBreakMode = .ByWordWrapping style1.alignment = .Center var attributedString =...

Does UIScrollview works correct with UIStatusbar?

ios,objective-c,uiscrollview,interface-builder,uistatusbar
my problem is related with UIScrollview. lets describe it, I have signup screen which has a scrollview, initially scrolling is not enabled. when keyboard appears I will enable scrollview and when keyboard hides again I am disabling scrolling. my scrollview’s width and height is same as its default view, I...

How to resize UIScrollView/ContainerView's height according to UITableview number of rows?

ios,objective-c,iphone,uitableview,uiscrollview
This is my ViewController in the storyboard: UIView (Controller) -UIScrollView --UIView --UIView --ContainerView ---UITableView (Embedded inside ContainerView) The UITableView has dynamic prototypes. My question is how do I change the UIScrollView and ContainerView's height to adapt to the UITableView's number of rows? I want to be able to scroll down...

UIScrollview with Auto-Layout

ios,objective-c,uiscrollview
I'm struggling with UIScrollView for a while now. "descriptionLabel" and "genresLabel" will increase height during runtime and the gap to actors will increase. So i need the scrolling functionality here to see the actors label. I set the height of the contentView as a height-constraint equal to View with priority...

Dynamic UIScrollView content: Unable to simultaneously satisfy constraints

ios,objective-c,uiscrollview,autolayout
I'm attempting to set up autolayout for a paging scroll view with a dynamic number of pages (one primary subview per page). My view hierarchy is set up as follows: Main view Scroll view UIView (fits content) TutorialSubview ... After adding all the views to an array, I have the...

How to scroll UICollectionView to the bottom programatically?

ios,objective-c,uiscrollview,uicollectionview
I have a UICollectionView. I want to scroll to the bottom when the view appears. How to do this? Can someone help me out on this?. Thanks in advance....

Dismiss keyboard with swipe gesture

ios,swift,uiscrollview
In Messages.app you can dismiss the keyboard down by scrolling the list view. To be clear, it isn't simply responding to a scrollViewDidScroll event. The keyboard tracks with your finger as you swipe down. Any idea how this is done?

How to make UIScrollView scrolling all content inside it

swift,uiscrollview,uitextview
I have UITextView, UIImageView, UILabel inside UIScroll View. I made that UITextView height equals its content and made scrollEnabled = false. UIScrollView scrolling not all content. I want that UIScrollView scrolling all content inside it. I want to make DetailViewController as in news applications. How do I make it?

UIScrollView + PageControl

ios,objective-c,uiscrollview,uipagecontrol
I have a view controller with outlets of scrollview (initial size: 390, 170) and page control. I need it to display an image per page from my array. But i have unexpected result (see image below). Images are not full-width and after 2nd page scrollView ends. Here is code -...

iOS: Changing view's frame is not working

ios,uiscrollview
I have a UIScrollview in my view controller, and I want dynamically change the its height. Here is the code: - (void)loadView { ... self.myScrollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; self.myScrollView.delegate = self; self.myScrollView.bounces = YES; self.myScrollView.showsHorizontalScrollIndicator = NO; ... } - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; self.myScrollView.frame = CGRectMake(0.0f, 0.0f, 300.0f,...

iOS Swift Problems putting 2 or more UITableView in a UIScrollView with datasource and delegate

ios,swift,uitableview,uiscrollview
I am trying to create a UIScrollView which consist of 2 or more UITableViews and the user can swipe left to right to switch between UITableViews What i have done so far is putting 2 UITableViews in a UIScrollView like this: class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet var theScroll:...

How to detect when a UIScrollView has finished scrolling In Swift

ios,swift,uiscrollview
There was, by all accounts, an excellent solution to this problem in Obj-C presented by Ashley Smart (How to detect when a UIScrollView has finished scrolling). -(void)scrollViewDidScroll:(UIScrollView *)sender { [NSObject cancelPreviousPerformRequestsWithTarget:self]; //ensure that the end of scroll is fired. [self performSelector:@selector(scrollViewDidEndScrollingAnimation:) withObject:nil afterDelay:0.3]; ... } -(void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView { [NSObject cancelPreviousPerformRequestsWithTarget:self];...

Scroll to scrollview page while scrollview is being resized

ios,swift,uiscrollview
I've got a scrollview with paging disabled. It has a number of subviews. Each of those has a width constraint and are constrained to each other and the scrollview, so when the subviews grow, the scrollview content area grows. When a subview is tapped, I run the following code: var...

How to achieve this custom Scroll bar in IOS or something similar to it?

ios,objective-c,uitableview,uiscrollview
Actually i have got a table view with options, but alongside i have got a complicated scroll design. How to achieve this custom scroll?? ...

Why do my image views placed inside a scroll view have distorted heights?

ios,swift,uiscrollview,uiimageview
I have an array of UIImageViews with each a different image and a function that places them inside a UIScrollView so they can be automatically scrolled like a slideshow. My scroll view has a height of 150 pixels and the images are 400x150 PDF's. For some odd reason on the...

iOS 7 - Layout advice

ios,objective-c,uiscrollview,autolayout,uicollectionview
I have the following layout in my view controller. I want to be able to scroll vertically with the header scrolling off the view and the UISegmentedControl sticking to the top of the view, beyond that the remaining scroll should be handled by the Collection View. However I'm a bit...

UIScrollView zoom auto

ios,objective-c,uiscrollview
As many others, i am trying to implement a zooming behavior with the UIScrollView. I am using Auto Layout to layout my subviews. In IB i have: ScrollView ImageView The imageView has constraints to fill up the entire scrollView, so the image will be displayed in it's full size on...

Displaying and scrolling a UIImageView (image) that is longer than screen

ios,objective-c,uiscrollview,uiimageview,autolayout
I have an image I want to display and it is longer than the screen size. The idea is I want it to scroll to show the entire image. I have created a UIImageView inside a UIScrollView and I can see the image in XCode but not when I run...

iOS : Change value by scrolling

ios,objective-c,iphone,xcode,uiscrollview
I am trying to change the alpha value of an UIView by scrolling in Up/Down directions via UIScrollView , my question is how can I set the alpha value of my view while user scrolls in up or down ? something like UISlider but with UIScrollView - (void)viewDidLoad { [super...

Scroll view not scrolling when more than one subview added [duplicate]

ios,objective-c,uitableview,uiscrollview,subview
This question already has an answer here: UIScrollView not scrolling 13 answers I'm adding subViews to a programmatically added UIScrollView, yet when the subViews go off the screen the scrollview isn't scrolling. Any Ideas? I need to update the content size of the scrollview more than once. First I...

UIScrollview w/ one large view, or UITableview w/ multable views?

ios,objective-c,iphone,uitableview,uiscrollview
Im working on a project that has a detailed view of a company's information. On the lower half of the view I have some buttons that don't move, but above them I have more content, that I can not fit into the screen for a 4s. So I'm thinking I...

Autolayouts in UIScrollView using Cirrious.FluentLayouts.Touch

ios,uiscrollview,xamarin,monotouch
I've to do a ViewController with autolayouts in scrollView, but here is few problems: public SomeVC() : UIViewController { _mainScrollView = new UIScrollView { ShowsHorizontalScrollIndicator = false, ShowsVerticalScrollIndicator = true, BackgroundColor = UIColor.Clear, ScrollEnabled = true, AutoresizingMask = UIViewAutoresizing.FlexibleHeight, TranslatesAutoresizingMaskIntoConstraints = true }; _userDataTableView = new UITableView(CGRect.Empty, UITableViewStyle.Grouped); _userDataTableView.LayoutIfNeeded(); _saveButton...

UIScrollView with Adaptive Layout

ios,uiscrollview,adaptive-layout
I have a UIScrollView inside a UIView and another UIView (the container view) inside the scroll view. Before adaptive layout I pinned the scroll view to fit the external view and set the width and height of the container view (that was pinned to the scroll view too). In this...

How does one utilize a UIScrollView.?

iphone,swift,uiviewcontroller,uiscrollview
I have created a UIScrollView in my VieController. I have a bunch of UILabels that fill up the entire screen from the top to the bottom of the UISrollView (the UIScrollView extends below the ViewController). I am unsure how to utilize the UIScrollView and how I would code it to...

To scroll UIScrollView programmatically but don't handle only this action in delegate methods?

ios,objective-c,animation,uiscrollview,delegates
In my class I wrote the following delegate methods: scrollViewDidScroll: scrollViewDidEndScrollingAnimation: Then for this scrollView I use the following code: scrollView.frame = ...; scrollView.contentSize = ...; [scrollView setContentOffset:... animated:NO]; The code and delegates work in a main thread but asynchronously to each other. The problem is I don't want to...