iphone - Optimization headers for UITableView? -


I have a customizable issue for table headers with plain style if I use standard view for table ( Title: Classic gray with title set by FHHeaderInSection) Everything is fine and scrolling is easy and immediate.

Instead, use this code to set up my personal view:

  - (UIView *) Table view: (UITableView *) table view view forHeaderInSection: ( NSInteger) section {return [self headerparty: [titoliSezioni object overindexx: section]]; } - (UIImageView *) HeaderParito: (NSString *) titolo {UIImageView * headerView = [[UIImageView alloc] initWithFrame: CGRectMake (10.0, 0.0, 320.0, 44.0)] autorelease]; HeaderView.image = [UIImage image named: kNomeImmagineHeader]; HeaderView.alpha = kAlphaSezioniTablePlain; UILabel * headerLabel = [[[UILabel alloc] initWithFrame: CGRectZero] Autorege]; HeaderLabel.backgroundColor = [UIColor clear collar]; HeaderLabel.opaque = NO; HeaderLabel.textColor = [UIColor whiteColor]; HeaderLabel.font = [UIFont boldSystemFontOfSize: 16]; HeaderLabel.frame = CGRectMake (10.0, -11.0, 320.0, 44.0); HeaderLabel.textAlignment = UITextAlignmentLeft; HeaderLabel.text = titolo; [Add HeaderView SUBview: headerLabel]; View return header; }  

Scrolling is jerky and not instant (finger on screen does not match an immediate change of sliding table).

I do not know what the cause is, Problem is that the fact that every time see the method ForHeaderInSection: The code runs to create a new UIImageView.

I tried a number of ways to solve the problem, like creating an array of all the necessary scenes: In addition to the time of loading on startup, there is a continuous problem of the low-jet jet.

The UIImageView size has been attempted to move from around 66KB to 4KB: Not only does the drop in quality of colors (which distort a bit 'original graphics), but ... problem Keeps maintained!

Perhaps you have suggestions about this, or I have ambiguous techniques that enable me to adapt this aspect of my application ...

I apologize for my English I have used Google for translation.

The main reason for recession is that every time a header view is requested, Are allocated to.

Since you know what the headings will look like, and you know how many are, you want to pre-create all the header views, store them in an array, and request them as a form of request. Can return.


Comments