Wednesday, 15 February 2012

iphone - UILabel in a grouped table view's header doesn't wrap text -


I have a label whose text is now heading the table view, so I want to split the label into N Lines according to the available width is my code:

  - (UIView *) TableView: (UITableView *) table view view FORMERInInformation: (NSInteger) section {if (section == 1} {UIView * Wrapper = [[UIView alloc] InitWithFrame: CGRectMake (0, 0, self.tableView.frame.size.width, 100)]; [Cover setbackgram color: [UIColor clearColor]]; UILabel * textLabel = [[UILabel alloc] InitWithFrame: CGRectMake (0, 0, self.tableView.frame.size.width, 100)]; TextLabel.te Xt = NSLocalizedString (@ "This is considered too long text which can fill multiple lines", @ ""); [TextLabel setLineBreakMode: UILineBreakModeWordWrap]; [Text Labell SetOfflineOffline: 0]; [wrapper add sbueview: text labels]; return Wrapper;} and return zero;}   

However, the label is in a line and I can not see the end of the text. What am I missing?

Thanks !

You must apply the delegate method to heightForHeaderInSection .

  - (CGFloat) TableView: (UITableView *) Table High HeightForheader Inception: (NSInteger) section {if (section == 1) returns 100; And return 0; }    

No comments:

Post a Comment