Xcode and storyboard: how to create a user profile view

how can I create a user profile view like this (Periscope, but similar to many other apps).

Is it a tableview manager? If so, how can I put the user image with a background (is it in the first cell or above the table?)

enter image description here

+3


source to share


4 answers


I would build it like this:

UIViewController

with UITableView

+ custom UIView

on top.

If you want to use already implemented libraries, check this:



They have very similar logic as described in your question.

+2


source


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{
           ....
       }
    }

      

+1


source


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

.

0


source


You can achieve the same user experience with UITableView

and add UIView

with a blue background like tableHeaderView

below.

UIView *headerView =  [[UIView alloc] init...];
tableView.tableHeaderView = headerView;

      

0


source







All Articles