1
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
//
|
||||
|
||||
#import "MySkinVC.h"
|
||||
#import "KBSkinDetailVC.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
#import "UIColor+Extension.h"
|
||||
#import <MJRefresh/MJRefresh.h>
|
||||
@@ -32,8 +33,11 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
|
||||
// self.title = @"My Skin"; // 标题
|
||||
|
||||
// 右上角 Editor/Cancel
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Editor" style:UIBarButtonItemStylePlain target:self action:@selector(onToggleEdit)];
|
||||
// 右上角 Editor/Cancel 使用 BaseViewController 自定义导航栏的 kb_rightButton
|
||||
self.kb_rightButton.hidden = NO;
|
||||
[self.kb_rightButton setTitle:@"Editor" forState:UIControlStateNormal];
|
||||
[self.kb_rightButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
|
||||
[self.kb_rightButton addTarget:self action:@selector(onToggleEdit) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
// 数据源初始化为空(演示空态 + 下拉刷新)
|
||||
self.data = [NSMutableArray array];
|
||||
@@ -104,7 +108,8 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
self.editingMode = !self.editingMode;
|
||||
|
||||
// 更新顶部按钮
|
||||
self.navigationItem.rightBarButtonItem.title = self.isEditingMode ? @"Cancel" : @"Editor";
|
||||
[self.kb_rightButton setTitle:(self.isEditingMode ? @"Cancel" : @"Editor")
|
||||
forState:UIControlStateNormal];
|
||||
|
||||
// 控制底部栏显隐
|
||||
self.bottomView.hidden = !self.isEditingMode;
|
||||
@@ -186,6 +191,8 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
if (!self.isEditingMode) {
|
||||
// 非编辑态:可在此进入详情,当前示例不处理
|
||||
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
|
||||
KBSkinDetailVC *vc = [[KBSkinDetailVC alloc] init];
|
||||
[self.navigationController pushViewController:vc animated:true];
|
||||
return;
|
||||
}
|
||||
MySkinCell *cell = (MySkinCell *)[collectionView cellForItemAtIndexPath:indexPath];
|
||||
|
||||
Reference in New Issue
Block a user