#import <UIKit/UIKit.h>
@interface StaticPrototypeCell : UITableViewController
@property (strong, nonatomic) IBOutlet UILabel *C1Title;
@property (strong, nonatomic) IBOutlet UILabel *C1Detail;
@property (strong, nonatomic) IBOutlet UILabel *C2Title;
@property (strong, nonatomic) IBOutlet UILabel *C2Detail;
@end
#import "StaticPrototypeCell.h"
@implementation StaticPrototypeCell
-(void)viewDidLoad
{
[super viewDidLoad];
self.C1Title.text = @"日期";
self.C1Detail.text = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterLongStyle
timeStyle:NSDateFormatterNoStyle];
self.C2Title.text = @"时间";
self.C2Detail.text = [NSDateFormatter localizedStringFromDate:[NSDate date]
dateStyle:NSDateFormatterNoStyle
timeStyle:NSDateFormatterLongStyle];
}
@end
实现步骤:
1,新增UITableViewController,选择TableView,Content属性为Static Cells。
2,可以设置Sections的个数,然后选择,设置行数等。
3,可以选择里面的任意单元格,然后设置其样式等,这里的label能直接访问了,不需要identifier了。
4,单元格里面带的label,不能修改大小等,是installed的,查了半天,没查出来怎么得到的!~