单军华
2018-07-11 acdf41fa3b32b628d9d7bba1f975060567dad3d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//
//  LMJCasesViewController.m
//  iOSProject
//
//  Created by windshan on 2018/1/22.
//  Copyright © 2018年 windshan. All rights reserved.
//
 
#import "LMJCasesViewController.h"
#import <DWBubbleMenuButton.h>
//#import "MCCornersRoundViewController.h"
#import "LMJSettingCell.h"
//#import "MCSphereTagCloudViewController.h"
//#import "MCLocalHTMLViewController.h"
@interface LMJCasesViewController ()
 
@end
 
@implementation LMJCasesViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"更多案例";
    
}
 
 
 
- (UIView *)lmjNavigationBarLeftView:(LMJNavigationBar *)navigationBar {
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0.f, 0.f, 44, 44)];
    
    label.text = @"Tap";
    label.textColor = [UIColor whiteColor];
    label.textAlignment = NSTextAlignmentCenter;
    label.layer.cornerRadius = label.frame.size.height / 2.f;
    label.backgroundColor =[UIColor colorWithRed:0.f green:0.f blue:0.f alpha:0.5f];
    label.clipsToBounds = YES;
    
    DWBubbleMenuButton *bubbleMenuButton = [[DWBubbleMenuButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44) expansionDirection:DirectionRight];
    bubbleMenuButton.homeButtonView = label;
    
    [bubbleMenuButton addButtons:[self createDemoButtonArray]];
    
    return bubbleMenuButton;
}
 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    [super tableView:tableView  cellForRowAtIndexPath:indexPath];
    LMJWordItem *item = self.sections[indexPath.section].items[indexPath.row];
    
    LMJSettingCell *cell = [LMJSettingCell cellWithTableView:tableView andCellStyle:UITableViewCellStyleSubtitle];
    
    cell.item = item;
    
    return cell;
}
 
 
- (NSArray *)createDemoButtonArray {
    NSMutableArray *buttonsMutable = [[NSMutableArray alloc] init];
    
    int i = 0;
    for (NSString *title in @[@"A", @"B", @"C", @"D", @"E", @"F"]) {
        UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
        
        [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [button setTitle:title forState:UIControlStateNormal];
        
        button.frame = CGRectMake(0.f, 0.f, 30.f, 30.f);
        button.layer.cornerRadius = button.frame.size.height / 2.f;
        button.backgroundColor = [UIColor colorWithRed:0.f green:0.f blue:0.f alpha:0.5f];
        button.clipsToBounds = YES;
        button.tag = i++;
        
        [button addTarget:self action:@selector(test:) forControlEvents:UIControlEventTouchUpInside];
        
        [buttonsMutable addObject:button];
    }
    
    return buttonsMutable;
}
 
- (void)test:(UIButton *)sender {
    NSLog(@"Button tapped, tag: %ld", (long)sender.tag);
}
 
- (UIView *)lmjNavigationBarTitleView:(LMJNavigationBar *)navigationBar {
    UILabel *label = [[UILabel alloc] init];
    
    label.text = @"更多案例titleView";
    label.textColor = [UIColor blackColor];
    label.textAlignment = NSTextAlignmentCenter;
    [label sizeToFit];
    label.height = 44;
    
    return label;
}
 
 
- (void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar {
    
    NSInteger count = [[sender titleForState:UIControlStateNormal] substringFromIndex:4].integerValue;
    count += 1;
    // 查看 UIButton+LMJBlock, 延时间隔点击
    [sender setTitle:[NSString stringWithFormat:@"点击次数%zd", count] forState:UIControlStateNormal];
 
    [sender sizeToFit];
    sender.height = 44;
}
 
- (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar {
    
    [rightButton setTitle:@"点击次数0" forState:UIControlStateNormal];
    [rightButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [rightButton sizeToFit];
    rightButton.height = 44;
    return nil;
}
 
@end