I am trying i am working on my social network app and I need to implement my profile settings window
To show what exactly I am talking about I will attach a picture.
https://pp.vk.me/c622224/v622224461/18d2f/lqcCCkXxHiY.jpg
I have 3 following questions:
1)Which kind of cells should be used (Static, Prototype, Dynamic) in order to create this kind of view.
2)How did they manage to resize 2 of 3 cells' width in order to fit an image there too
3)Are these gaps between different sections being a different table?
1 - You must use prototype cells in order to change the data for each user
2 - The photo section can be a UIView added as subview to UITable
3 - The gaps are not because of different tables, is a table setup as Grouped instead of Plain.
Related
I noticed in the Airbnb app when you click on a specific cell on the home screen, they have a complex collection view displaying various items in different looking collection view cells. I have attached 4 pics below:
In those pictures you have different sections like About your host, Availability, Reviews, Group size up to 2 guests, Guest requirement, Contact Host, etc. How does one go about organizing a view like this?
Is this just a bunch of different cells in a TableView or CollectionView? Since every single item I click on the home screen has a very similar layout with the exact same sections. Or are these just views placed on a scrollview?
It's probably a UITableView or UICollectionView with a set of different cells. So their cellForRowAtIndexPath: cellForItemAtIndexPath: functions would return a different cell class for each different section.
They'll have an AboutYourHostCell class, an AvailabilityCell class, a ReviewsCell class, etc.
It would be possible to do this by adding Views into a UIScrollView, but it would be a lot of work, and you'd lose some nice behaviour that UITableView or UICollectionView provides - like highlighting cells when you press and hold, and animating changes.
I have this click issue on my Swift app. I'm building a profile screen with 2 UITableViews on it inside a UIScrollView. However, only 1 UITableCell is clickable (The reason why both tables have to be separated is because the top table is sorted ASC - from the latest to future dates while the bottom table is sorted DESC - from the most recent to the oldest).
The tables are auto-stretched based on the contents as shown in the code down below. The problem is only the first item is clickable.
Everything is okay in other screens with 1 UITableView. I also made sure there are no views in-front of the tables using the UI Debugger.
// Table 1
// UITableViewDelegate, UITableViewDataSource
managerUpcoming.getTable().reloadData()
// Height Constraint
heightUpcoming.constant = managerUpcoming.getTable().contentSize.height
// Resize table
managerUpcoming.getTable().frame.size.height = heightUpcoming.constant
// Update
managerPrevious.getTable().updateConstraints()
// Table 2
// UITableViewDelegate, UITableViewDataSource
managerPrevious.getTable().reloadData()
// Height Constraint
heightPrevious.constant = managerPrevious.getTable().contentSize.height
// Resize table
managerPrevious.getTable().frame.size.height = heightPrevious.constant
// Update
managerPrevious.getTable().updateConstraints()
viewContent.frame.size.height = total
scroll.contentSize.height = viewContent.frame.height
Any help and suggestions are highly appreciated. Thanks.
Having two table views inside a scrollview is a bad design IMO. Even going to the other side of the universe of Android development will suggest you not to do it. Based on the picture that you've provided on how you wanted to place the two table views, might as well have:
two separated array for the data that you've wanted to be ordered descending and one for ascending.
populate your table view in two sections. If section 0 is for ascending items then load the row / cell data within that section using your ascending data / array, then do the same for your section 1 using your descending data / array. This can easily be achieved by conditional statements inside the data source method implementation for the section and cell.
If you think you still have to implement sections on each of the already section-separated cells, then by all means you can create a custom cell to act as a section-like layout. You are not limited to create custom cells, just handle them with care.
If this simple approach isn't enough, then you can use a more advanced implementation using a collection view and that's already a different topic based on your question.
The main problem on your current design (using 2 tableviews inside a scrollview) will most probably lead you to inefficient loading of data since you need to load all the data on both of your tables just to determine the content height for the scrollview. Aside from the fact that the gestures needed additional routing, your current design will restrict the ability of your app to lazily load only the cells / data needed to be shown at the moment.
I am have to show three different cells like (Facebook post) with all different size and design. The data is coming from server.What is the best way to deal with it. I have to use UITableview or UICollectionview there are three kinds of cells like:
News
Movies
Spots
Each cell type has different design, I want to identify each cell type from the data obtained from server and configure and display the correct cell.
The Cells Look Like This :
In the storyboard, add as many prototype cells you need. Then, to each create a different identifier (and its own class). Shape each to how you want it to look.
I am working on an app using objective C and Xcode.
For the moment I am using a table view and returning rows with cells containing an image thumb and title. My problem is that now i need to change the layout and for 4 of the cells I need to make them fall on the same row (so each article of the 4 should be 50% width). So basically create 2 columns but only for 4 of the articles. The rest remain on 1 column (full width).
I would add an image but I don't have enough rep points.
I know there is some thing like collection view...but I am not very familiar with that one and I was hoping maybe there's an easier way than redoing the viewcontroller and all the connections I already have created there.
Since I am already using tableview..what's the best way to change the layout to fit what I need now?
Based on what you're trying to do a UICollectionView might not be the best bet. I would create a second type of UITableViewCell for those rows with 4 columns. This should help Multiple Custom Rows UITableView?
You can use UICollectionView with flowlayout and variable cell width. There are many tutorials about it out there.
You can also try this library: https://github.com/bryceredd/RFQuiltLayout
Have you taken a look at this library:TSUIKit
If you just want to quickly arrange your data, this would be much easier than trying to wrangle with UICollectionView.
I have a set of data in a matrix which I would like to display in my iPhone app with all of the rows and columns intact. Everything I can find on the web dealing with "tables iPhone" gives me information on UITableView, which only lets you show a list of items to the user - not an actual table in the HTML sense. What's the best way on the iPhone to display an actual table of data to the user, with column & row headings and table cells?
The solution that I found was simply to use a UIWebView. Then I can build the HTML table dynamically and load it into the web view.
The UITableView class was specifically designed to only show one column at a time due to the small size of the screen. If the data of your application absolutely needs to be laid out in one big grid on one screen the right way to do it, would be to add each cell as a subview to a custom view. Then implement the layoutSubviews method on your custom view to lay out the frames of the subviews in the grid you want.