@@ -46,7 +46,7 @@ - (void)layoutSubviews
46
46
// imageView 和 titleLabel 中心的 Y 值
47
47
CGFloat const centerOfImageView = verticalMargin + imageViewEdge * 0.5 ;
48
48
CGFloat const centerOfTitleLabel = imageViewEdge + verticalMargin * 2 + labelLineHeight * 0.5 + 5 ;
49
-
49
+
50
50
// imageView position 位置
51
51
self.imageView .bounds = CGRectMake (0 , 0 , imageViewEdge, imageViewEdge);
52
52
self.imageView .center = CGPointMake (centerOfView, centerOfImageView);
@@ -64,18 +64,18 @@ - (void)layoutSubviews
64
64
*
65
65
*/
66
66
+ (instancetype )plusButton {
67
-
67
+
68
68
CYLPlusButtonSubclass *button = [[CYLPlusButtonSubclass alloc ] init ];
69
-
69
+
70
70
[button setImage: [UIImage imageNamed: @" post_normal" ] forState: UIControlStateNormal];
71
71
[button setTitle: @" 发布" forState: UIControlStateNormal];
72
-
72
+
73
73
[button setTitleColor: [UIColor grayColor ] forState: UIControlStateNormal];
74
74
button.titleLabel .font = [UIFont systemFontOfSize: 9.5 ];
75
75
[button sizeToFit ];
76
-
76
+
77
77
[button addTarget: button action: @selector (clickPublish ) forControlEvents: UIControlEventTouchUpInside];
78
-
78
+
79
79
return button;
80
80
}
81
81
@@ -86,18 +86,18 @@ + (instancetype)plusButton{
86
86
*/
87
87
// + (instancetype)plusButton
88
88
// {
89
- //
89
+ //
90
90
// UIImage *buttonImage = [UIImage imageNamed:@"hood.png"];
91
91
// UIImage *highlightImage = [UIImage imageNamed:@"hood-selected.png"];
92
- //
92
+ //
93
93
// CYLPlusButtonSubclass* button = [CYLPlusButtonSubclass buttonWithType:UIButtonTypeCustom];
94
- //
94
+ //
95
95
// button.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
96
96
// button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height);
97
97
// [button setBackgroundImage:buttonImage forState:UIControlStateNormal];
98
98
// [button setBackgroundImage:highlightImage forState:UIControlStateHighlighted];
99
99
// [button addTarget:button action:@selector(clickPublish) forControlEvents:UIControlEventTouchUpInside];
100
- //
100
+ //
101
101
// return button;
102
102
// }
103
103
@@ -108,18 +108,18 @@ - (void)clickPublish {
108
108
UITabBarController *tabBarController = (UITabBarController *)self.window .rootViewController ;
109
109
UIViewController *viewController = tabBarController.selectedViewController ;
110
110
111
- UIActionSheet *actionSheet = [[UIActionSheet alloc ]initWithTitle:nil
112
- delegate: nil
113
- cancelButtonTitle: @" 取消"
114
- destructiveButtonTitle: nil
115
- otherButtonTitles: @" 拍照" , @" 从相册选取" , @" 淘宝一键转卖" , nil ];
111
+ UIActionSheet *actionSheet = [[UIActionSheet alloc ] initWithTitle: nil
112
+ delegate: nil
113
+ cancelButtonTitle: @" 取消"
114
+ destructiveButtonTitle: nil
115
+ otherButtonTitles: @" 拍照" , @" 从相册选取" , @" 淘宝一键转卖" , nil ];
116
116
[actionSheet showInView: viewController.view];
117
117
}
118
118
119
119
#pragma mark - UIActionSheetDelegate
120
120
121
121
- (void )actionSheet : (UIActionSheet *)actionSheet didDismissWithButtonIndex : (NSInteger )buttonIndex {
122
- NSLog (@" buttonIndex = %ld " , buttonIndex);
122
+ NSLog (@" buttonIndex = %@ " , @( buttonIndex) );
123
123
}
124
124
125
125
#pragma mark - CYLPlusButtonSubclassing
0 commit comments