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

How serious is the "second-degree minor injury" of the Tangshan girl?

On June 21, the Hebei Provincial Public Security ...

How does a popular video game become popular?

The most direct criterion for evaluating the qual...

Tianzhou-4 sets sail, China's space station gets new features

At 1:56 a.m. on May 10, the Long March-7 carrier ...

String theory in the garden

How to quantize gravity is a puzzle for theoretic...

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

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

Report on the operation of the automobile physical market in October 2021

Key sampling of automobile tangible markets (park...

Keyword selection tips for bidding accounts!

SEM account optimization generally refers to the ...