|
|
@@ -52,23 +52,23 @@ static NSString * const kCellID = @"PreferencesViewControllerCellID";
|
|
|
NSArray *array = @[@{
|
|
|
@"title":@"联系人列表",
|
|
|
@"image":tmpimage,
|
|
|
- @"class":[NSObject class]},//ContactListClass
|
|
|
+ @"class":@"ContactListClass class"},//ContactListClass
|
|
|
@{
|
|
|
@"title":@"回收站",
|
|
|
@"image":tmpimage,
|
|
|
- @"class":[RecyleViewController class]},
|
|
|
+ @"class":@"RecyleViewController"},
|
|
|
@{
|
|
|
@"title":@"主题",
|
|
|
@"image":tmpimage,
|
|
|
- @"class":[NSObject class]},//ThemeViewController
|
|
|
+ @"class":@"ThemeViewController"},//ThemeViewController
|
|
|
@{
|
|
|
@"title":@"通讯录同步",
|
|
|
@"image":tmpimage,
|
|
|
- @"class":[NSObject class]},//SyncAddressBookViewController
|
|
|
+ @"class":@"SyncAddressBookViewController"},//SyncAddressBookViewController
|
|
|
@{
|
|
|
@"title":@"正在研发",
|
|
|
@"image":tmpimage,
|
|
|
- @"class":[NSObject class]}//DevelopingViewController
|
|
|
+ @"class":@"DevelopingViewController"}//DevelopingViewController
|
|
|
];
|
|
|
for (NSDictionary *dict in array) {
|
|
|
BAGridItemModel *model = [BAGridItemModel new];
|
|
|
@@ -180,23 +180,29 @@ static NSString * const kCellID = @"PreferencesViewControllerCellID";
|
|
|
weakSelf.gridView = tempView;
|
|
|
|
|
|
} block:^(BAGridItemModel *model, NSIndexPath *indexPath) {
|
|
|
- //const char className = model.className;
|
|
|
- UIViewController *kclass = [model.classWithName new];
|
|
|
- if (kclass) {
|
|
|
- [weakSelf.navigationController pushViewController:kclass animated:YES];
|
|
|
+
|
|
|
+ Class objclass = NSClassFromString(model.classWithName);
|
|
|
+ if (objclass) {
|
|
|
+ id viewcontroller = [[objclass alloc]init];
|
|
|
+ UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:viewcontroller];
|
|
|
+ [weakSelf presentViewController:nav animated:YES completion:nil];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
NSLog(@"tap:%@",indexPath);
|
|
|
// BAKit_ShowAlertWithMsg_ios8(model.titleString);
|
|
|
}];
|
|
|
- gridview.frame = CGRectMake(0, CGRectGetMaxY(avatarview.frame)+20, screenW, kGridView_H);
|
|
|
- [self.view addSubview:gridview];
|
|
|
+ gridview.frame = CGRectMake(0, CGRectGetMaxY(avatarview.frame)+20, screenW, kGridView_H+20);
|
|
|
+ //[self.view addSubview:gridview];
|
|
|
self.gridView = gridview;
|
|
|
-
|
|
|
+ CALayer *garylayer = [CALayer layer];
|
|
|
+ garylayer.frame = CGRectMake(0, kGridView_H, screenW, 10);
|
|
|
+ garylayer.backgroundColor = self.view.backgroundColor.CGColor;
|
|
|
+ [gridview.layer addSublayer:garylayer];
|
|
|
residualRightH =screenH - CGRectGetMaxY(gridview.frame) +20;
|
|
|
|
|
|
|
|
|
- UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(gridview.frame)+20, screenW, residualRightH) style:UITableViewStylePlain];
|
|
|
+ UITableView *tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(avatarview.frame)+20, screenW, screenH- CGRectGetMaxY(avatarview.frame) -64) style:UITableViewStylePlain];
|
|
|
//footview
|
|
|
UIView *footview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, screenW, 54)];
|
|
|
UIButton *exitBtn = [UIButton buttonWithType:UIButtonTypeSystem];
|
|
|
@@ -207,6 +213,7 @@ static NSString * const kCellID = @"PreferencesViewControllerCellID";
|
|
|
|
|
|
[footview addSubview:exitBtn];
|
|
|
tableView.backgroundColor = [UIColor clearColor];
|
|
|
+ tableView.tableHeaderView = gridview;
|
|
|
tableView.tableFooterView = footview;
|
|
|
[self.view addSubview:tableView];
|
|
|
tableView.dataSource = self;
|
|
|
@@ -217,7 +224,7 @@ static NSString * const kCellID = @"PreferencesViewControllerCellID";
|
|
|
[self.progressview setProgress:.34 animated:YES];
|
|
|
}
|
|
|
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
|
|
- return 3;
|
|
|
+ return self.tableDataArray.count;
|
|
|
}
|
|
|
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellID];
|