Coldsteel48
Coldsteel48

Reputation: 3512

Table view first cell always same

well my issue is:

I want to have table view but I want to keep first cell always first , and never let it scroll but other cells should scroll.

can someone please suggest me how to do so ?

Upvotes: 0

Views: 208

Answers (2)

user862972
user862972

Reputation: 224

The above answer with the static cell in the header works.

You might want to create another tableview just above the present one, with just static cells in it. Just below this table view, keep the present one with (number of all cells - number of static cells) without any offset. It looks as just one table view. This way, you can have more than one static cell with all the properties of a Tableview cell.

Upvotes: 1

user1548843
user1548843

Reputation: 670

If your table have only one section than create custom view like cell and add this view in table delegate method

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 

like

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
   return <Your View>
}

but it works if and only if one section in given in table.

Upvotes: 2

Related Questions