add buttons to footer in UIView in which footer is fixed - ios

I have a UIView with UIScroll for it. I want to add buttons for footer in which the footer is fixed and the scroll continues… Thanks in Advance.

See the view hierarchy in attached screenshot :
You can bind the button action and scroll as per your requirenment.
Full heirarchy :

You can do this like.
Place your scrollview on view and leave some space from bottom for button. then add button on that space. set contraint to it. its simple.

Take one UIView like containerview.
Add scrollview and button in that view

You need to subview a view on scrolls views super view. Set the constraints to the bottom. Then add button on top of the newly added view.
Keep your scroll view behind your newly added view. SO that it will scroll and not the bottom newly added view.

Related

Interacting with screen behind UIScrollview

I have a view where content is supposed to scroll over a few elements. One of which is a button. What I did is place the button and all background elements, and then created a scrollview on top of that.
However, the touch events now (obviously) go to the scrollview, and not to the elements in the back. Is it possible to enable interaction through the empty parts of a scroll view?
Screenshot here:
There is a scrollview on top of e.g. the "next" and "edit" buttons. but I'd like these to be clickable anyways.
Thanks.
I'm going to assume that the content you want to scroll is in a subview. ScrollViews always serve as the first layer of any scrollable UI. Put scrollview in your subview then UIView over your ScrollView and over that add your elements.

How to put a UIView in a UITableView and It will be pinned on the bottom

I am trying to build a UITableView Controller, which will be my app's ABOUT information session.
At the bottom of the view, it will be reserved as circle menu. So I need a UIView with height of 200 there, when I drag a UIView to the controller, it always sit as a table cell.
As you can see, the red area always sit under the last table cell group, how to pin it on the bottom of the View Controller.
Thanks in advance.
You can't add a UIView at the bottom of the UITableViewController. If that is a hard requirement you have to switch to UIViewController. And then you can use UITableView and other UIView's as well.
If you are using a navigation controller with UITableViewController then you can use UIToolBar which sticks at the bottom of view controller but have some limitations too. See this
Get UIView controller and put tableview instead of UITableViewController. From side inspector drop UIView out of tqbleview. And in inspector menu for UIView set auto resizing mask for UIView according.

Scrolling up UICollectionView don't move a UIView above it

I am working in a profile ViewController. This profile has a main image in a UIView subclass and a CollectionView gallery with some images. I would like to be able to scroll up the UICollectionView and move the UIView too, and if I scroll down, I want to watch again the UIView when the collectionView first item is showed again.
I have tried to do this adding the collectionView and the UIView to a ScrollView, but the UIView only scroll up if I touch it.
In this picture you can see my problem
Thank you in advance
You need to make the view at the top a Header View of the collection view.
Essentially it needs to be an actual part of the collection view if you want this action. (That's the easiest way anyway).
So the collection view will take up the whole screen but it will have a header view. Then when you scroll the collection view the header will move out of view and then come back in when you scroll down again.

Advice on how to use a UIScrollView

Hello I have some app (from book) which looks like this:
You can see the image is cropped. I want to have a UIScrollView
which allows to scroll up and also see the whole picture.
This is how my app looks in interface builder.
What do you suggest where should I add ScrollView (as which subview etc.) to achieve what I need? (I guess I will need some intermediary UIView?)
This is what I usually do for fixed contents:
In IB create your view with a UIScrollView at your desired size and position connected to a scrollView outlet.
Also in IB create the view for the contents (bigger than the scroll view). Connect this to a UIView outlet called contentView.
In viewDidLoad do this:
// Put the content view into the scroll view
[self.scrollView addSubview:self.contentView];
self.scrollView.contentSize = self.contentView.bounds.size;
If you want dynamic contents then programatically lay them out in viewWillLayoutSubviews and set the contentSize of the scrollView.
Add the UIScrollView as a direct child of Control, and then put everything else inside the scroll view.
Add UIScrollView as first child of your main View and put all of your controls (UITextView, UILabel,...etc ) as sub view of UIScrollView.
And use UIScrollView property contentSize for set your visible area.
For more information read this tutorial.
You should add the UIScrollView directly under Control, then everything else, besides the toolbar should go into it.
What I usually do in these cases is set the scrollView to the size so all content fits, add the content, then resize the scrollview so it only occupies as much of the screen you want.

ios : tableview not appearing in subview of a scrollview

I have a scrollview with multiple views.Enabled horizontal scrolling.Each view contains a tableview.I have page control in scrollview. when i drag horizontally, the views are appearing without tableview except the first view. Please give me suggestions.
Make sure if setContentSize to your scrollview means scrollview content size is the size of your main view.
When you scroll to next view or if you scroll to view displayed for first time, make sure you reload table. You can implement his through delegate and protocols. For example, when you scroll to second view for first time, then controller should call some method on subview to reload its table.

Resources