Xcode and storyboard: how to create a user profile view
This is a custom tableview control. It's all a cell, but it's hard to create with just a storyboard. you create a dynamic table view for it and ad prototype cell 3 (1: blue cell, 2: gray blank cell, 3: optional cell). And create a controller and manipulate the cell with it like:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if(indexpath.row== 0)
{
HeaderCell *cell = [tableView dequeueReusableCellWithIdentifier:@"headerCell" forIndexPath:indexPath];
cell.name = "foo";
....
}
else if(indexpath.row ==1 || indexpath.row ==3)
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"blankCell" forIndexPath:indexPath];
[cell setBackgroundColor:[UIColor greyColor]];
}else{
....
}
}
source to share
It looks like the above is the header view and below the table view.
If the above part is scrolled, it is a table view tableHeaderView
. In this case, you can use UITableViewController
.
Otherwise, you have to use UIViewController
with UIView
as the header and UITableView
below it, and you must declare the table view delegate
and yourself datasource
.
source to share