Login page with scrolling horizontally only images - ios

I want to create tinder like login page(onboarding). While scrolling images horizontally, the header must be the same for every UICollectionViewCell. However, but when I scroll, header doesn't stay fixed. Every time I scroll headers go left or right also. Should I use something different rather than UICollectionView ?
Imageviews must move but textview must stay fixed.

Your Collectionview cell must only content imageview and not textfield.
Also if you share the UI design of what is required and developed screen then it will be more easy to give you correct answer.
Hope this will be helpful.

Related

Scrolling issue with WebView inside UIPageViewController

I have a UIPageViewController in which each of the child view controller contains a WKWebview.
The content of WebView is structured in two parts:
The top part contains a fixed size header in a div.
The bottom part contains the content, that can be larger than the device.
You can see a representation in the following drawing:
When the content is larger than the device, the user needs to scroll the content horizontally until the end of it in order for the UIPageViewController to start the swipe between two pages, and this is expected.
The problem is that the top part contains a fixed size header, and so if the user starts the scrolling in the header, it still need to scroll horizontally to the end of the content for the swipe to start. This is obviously not user friendly, and I am not sure how to solve this issue.
Do you have any suggestions about this?
You can try it something like:
Take two different UIPaginationViews, One for Header and one for
Contents.
Now, add these UIPaginationView's to ScrollView and enable vertical scrolling.
In delegate method, if the user scroll the page of Header
PaginationView then you can set the appropriate Index on the
Contents PaginationView. As the width of the Header is equal to the
width of the screen, so scrolling it to next page is smooth.
Now, when user scrolls on the bottom content and page get's
changed then you will have to set the index on the top pagination
view to match the contents pagination view.
In the scrollView, Allow only vertical scrolling. so, when you
scrolls it will scroll both the UIPaginations views.
it will need little experiments to get the desired behaviour and first thing you will have to do is to separate the HEADER AND CONTENT. if that is possible then you can try this approach.
Hope it helps.

How to set Table view cell to occupy entire screen?

I am working on a project to get custom news feeds from Bing news. I created a custom table view cell and populated various UI items in it. But I am having a hard time to make it occupy the entire screen, it starts from extreme left and ends on the right, leaving large gap from the right margin as show in the image. Can anyone help me out, how to correctly fix it with a detailed explanation of how constraints work in Table views and Tableview cells.
Here' what it looks like in the simulator
Remove previous constraints and add constraint to your UITableView like as shown in below image.
So you UITableView will have 0 margin from edges.
Create a UITableViewController. Just drag drop a TableViewCell into it. Add identifier for that cell and use it. By default it will occupy the whole screen.
In your case I guess you might have added constraints to UITableView. Here what you should do is pin your UITableView to Top,Bottom,Right & Left or make UITableView's width equal to SuperView.

UICollectionView within UITableViewCell with Swipe

I am using Xcode 7.1 and Swift 2.1 version.
I am looking for something as shown in the picture
Here in the left screen (Before Swiping), I have a UITableView in which there are certain cells in which I have to implement a right swipe functionality.Now when I swipe right the one coming from right must be a UICollectionView as shown in right picture (After Swipe) as there can be many options (a,b,c,d,e....). So they should be in some scroll view like UICollectionView.I searched a lot and found some libraries like
https://github.com/MortimerGoro/MGSwipeTableCell
https://github.com/CEWendel/SWTableViewCell
They provide array of UIButton or a single Button with image or text. We can add multiple buttons but they will shrink accordingly.
I want something called a UIView in which I can place UICollectionView and make its datasource accordingly with fixed size cells as shown in the picture.Any source or link for the same is highly appreciable.
Thanks

iOS controlling the scroll position of UIScrollView?

I'v some strings of different size in an array, i added them to UIScrollView by using UILabel
user can scroll horizontally to see all the names.But i want when user scroll either side he should see next/previous name from list as we do in paging enabled scroll view but here i want only one name(of different size) to be scrolled, not the whole screen.How to achieve this?Any help or suggestion would be highly appreciated.
Edit: - for better understanding suppose initially 0th, 1st and 2nd strings from my array is visible on scroll view, and when user scroll it should show 1st, 2nd and 3rd strings from my array(and vice versa for scrolling to other side).
You can do this by contentoffset.
set contentoffset of scrollview and you can able to do this.

How to create a layout like Featured page in App Store?

I'm new in iOS development. Based on my assumption, Feature page in App Store was created using a combination of UITableView and UICollectionView. But how to do that in theory and code? I know it's a bit vague, because it's quite hard to describe it, but I just need some people to help me explain it.
For this case I will try to use these naming:
1. Top section, it's a view which showing banners of apps, people can swipe it to view another banner.
2. Middle section, views which can be scrolled horizontally. (Best New Apps, Best New Games, etc).
3. Bottom section, starts from Quick Links to the bottom.
Questions:
1. The scroll indicator is starts from the root view's top guide, that's normal, but:
a. When we scroll it up, the bounciness is start from the middle section. How to do that? Is the top section and middle section is a separated view? But how can the scroll indicator is started from the root view's top guide if top and middle section is a separated view? (Separated view means that the views should have different scroll indicator unless it's actually subviews of UIScrollView).
b. When we scroll it down, there is nothing that floating. So it looks like that the whole page is a subview of a single scroll view but the bounciness is starts from the middle section. How to create that bounciness effect while only have one scroll indicator for the whole page?
2. In the middle section, there's a several collection view that has horizontal scroll direction. Is it the best way to create it like that is to use UITableView with cell that has UICollectionView inside it? It looks like it was created that way, but:
a. Is it the most efficient way to do that?
b. Because of the case in my first question is my source of confusion.
3. The bottoms section has a different separator from the middle section. The middle section has indentation while the bottom section doesn't. How can I do that if the case is it's a UITableView?
My whole question is just how to create a layout like that. If you cannot help me by providing me some sample codes that's fine, please just explain me the concept or theory of how to do that.
If the whole answer is just I have to create it using vertical/horizontal UIScrollView from scratch that's fine. I just want to make sure of that since I tried to avoid dealing with creating manual tiling.
OK, I think I finally found my own answer.
First, I need a UIScrollView to be root of the view. Then I set the contentSize to be a specific value.
The top section can be a UIPageController or a horizontal UIScrollView.
The middle section is a UITableView with scrollEnabled to NO and cells are static. The static cells (could also be dynamic cells) will contains UICollectionView. Since the scroll is disable, it will use the scroll from the parent UIScrollView. So that's why I can get the same bouncy effect in the middle section.
The bottom section is just another cell of a UITableView.
Thanks.
This might help you with implementing UICollectionViews in your UITableViewCell: http://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell
To make the first cell "float" in the TableView you could make sure that cell never goes out of screen in scrollViewDidScroll

Resources