mirror of
https://github.com/zhigang1992/RETableViewManager.git
synced 2026-06-19 18:24:13 +08:00
Add textAlignment property
This commit is contained in:
@@ -80,6 +80,7 @@
|
||||
self.textLabel.text = item.title;
|
||||
self.accessoryType = item.accessoryType;
|
||||
self.accessoryView = item.accessoryView;
|
||||
self.textLabel.textAlignment = item.textAlignment;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
@interface RETableViewItem : NSObject
|
||||
|
||||
@property (copy, readwrite, nonatomic) NSString *title;
|
||||
@property (assign, readwrite, nonatomic) NSTextAlignment textAlignment;
|
||||
@property (weak, readwrite, nonatomic) RETableViewSection *section;
|
||||
@property (assign, readwrite, nonatomic) BOOL performActionOnSelection;
|
||||
@property (copy, readwrite, nonatomic) NSString *detailLabelText;
|
||||
|
||||
@@ -103,6 +103,16 @@
|
||||
[section2 addItem:[RETableViewItem itemWithTitle:@"Accessory 2" accessoryType:UITableViewCellAccessoryCheckmark actionBlock:^(RETableViewItem *item) {
|
||||
[weakSelf.tableView deselectRowAtIndexPath:item.indexPath animated:YES];
|
||||
}]];
|
||||
|
||||
RETableViewSection *section3 = [[RETableViewSection alloc] init];
|
||||
[_manager addSection:section3];
|
||||
|
||||
RETableViewItem *buttonItem = [RETableViewItem itemWithTitle:@"Test button" accessoryType:UITableViewCellAccessoryNone actionBlock:^(RETableViewItem *item) {
|
||||
[weakSelf.tableView deselectRowAtIndexPath:item.indexPath animated:YES];
|
||||
NSLog(@"Button pressed");
|
||||
}];
|
||||
buttonItem.textAlignment = NSTextAlignmentCenter;
|
||||
[section3 addItem:buttonItem];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user