iOS source code download: stacked cells in groups

iOS source code download: stacked cells in groups

Supported platforms: iOS

Operating environment: iOS

Development language: Object-C

Development tools: Xcode

Source code size: 60.27KB

Source code download address: http://down..com/data/1975620

Source code introduction

The third-party library TFStackingSectionsTableView can stack cells in groups. The group header is displayed on the table, and clicking the group header can expand the corresponding cell.

Source code running screenshot

Rendering

Source code snippet

  1. - ( void )viewDidLoad
  2. {
  3. [super viewDidLoad];
  4.       
  5. self.groups = @[@ "Group A" , @ "Group B" , @ "Group C" , @ "Group D" , @ "Group E" , @ "Group F" , @ "Group G" , @ "Group H" ];
  6. self.members = @[
  7. @[@ "Brazil" , @ "Mexico" , @ "Croatia" , @ "Cameroon" ],
  8. @[@ "Netherlands" , @ "Chile" , @ "Spain" , @ "Australia" ],
  9. @[@ "Columbia" , @ "Greece" , @ "Côte D'Ivoire" , @ "Japan" ],
  10. @[@ "Costa Rica" , @ "Uraguay" , @ "Italy" , @ "England" ],
  11. @[@ "France" , @ "Switzerland" , @ "Ecuador" , @ "Honduras" ],
  12. @[@ "Argentina" , @ "Nigeria" , @ "Bosnia and Herzegovina" , @ "Iran" ],
  13. @[@ "Germany" , @ "USA" , @ "Portugal" , @ "Ghana" ],
  14. @[@ "Belgium" , @ "Algeria" , @ "Russia" , @ "Korea Republic" ]
  15. ];
  16. }
  17. - (UIView *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
  18. return self.groups[section];
  19. }
  20.   
  21. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  22. {
  23. return nil;
  24. UILabel *label = [UILabel new ];
  25. label.text = [@ " " stringByAppendingString:self.groups[section]];
  26. label.backgroundColor = [UIColor colorWithWhite:0.97f alpha:1.0];
  27. label.textColor = [UIColor colorWithWhite:0.13f alpha:1.0];
  28. label.font = [UIFont boldSystemFontOfSize:14.0f];
  29. return label;
  30. }

Source code download address: http://down..com/data/1975620

<<:  Android decompilation: decompilation tools and methods

>>:  iOS source code download: Implementing custom drawing functions

Recommend

Why are airplane windows rounded instead of square?

Nowadays, airplanes have become an indispensable ...

Can't buy vitamin C? Don't panic, these foods are very good for vitamin C!

With the relaxation of new epidemic prevention po...

Top 3 professional Baidu SEM hosting service companies ranking

How to choose a Baidu SEM hosting company is a he...

ThunderSoft exhibits mobile security, IOT and other solutions at CES

The 2015 Global Consumer Electronics Show (CES) w...

How to operate private domain? 7 ways to operate private domain!

Private domains are very popular, but the informa...

From 0 to 1, how to write a marketing plan with "soul"?

"Every marketing plan with soul must not be ...

Local temperature drops by more than 10℃! A new wave of cold air is coming

The Central Meteorological Observatory predicts t...

WeChat 3.0.0 Mac official version released: finally open Moments

[[390583]] After more than half a month of intern...

Second-hand trading website advises selling old iPhone as soon as possible

Gazelle, a well-known second-hand electronic cons...

Take these Zhihu promotion and follower-increasing tips for free!

In the past two years, the Internet industry has ...

New Media Operation: Free Gif compression tool, take it away quickly!

Anyone working in new media knows this Gif image ...