Skip to content

Commit 8c155f1

Browse files
committed
add separator line color custom item
1 parent aa668d7 commit 8c155f1

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

FEPopupMenuController/FEPopupMenuController.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,9 @@
7070
*/
7171
@property (nonatomic, assign) BOOL isShowArrow;
7272

73+
/**
74+
* the separator line color of each item, default is light grey (r:0.93,g:0.93,b:0.93)
75+
*/
76+
@property (nullable, nonatomic, strong) UIColor *itemSeparatorLineColor;
77+
7378
@end

FEPopupMenuController/FEPopupMenuController.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ -(instancetype)initWithItems:(NSArray<FEPopupMenuItem *> *)items {
3535
self.contentViewCornerRadius = 8.0;
3636
self.arrowX = self.contentViewWidth - 25.0;
3737
self.isShowArrow = NO;
38+
self.itemSeparatorLineColor = [UIColor colorWithRed:0.93 green:0.93 blue:0.93 alpha:1];
3839
}
3940
return self;
4041
}
@@ -71,7 +72,7 @@ - (void)viewDidLoad {
7172
[self.tableView registerNib:[FEPopupMenuItemCell nib] forCellReuseIdentifier:[FEPopupMenuItemCell identifier]];
7273
self.tableView.delegate = self;
7374
self.tableView.dataSource = self;
74-
self.tableView.separatorColor = [UIColor colorWithRed:0.96 green:0.96 blue:0.96 alpha:1];
75+
self.tableView.separatorColor = self.itemSeparatorLineColor;
7576
self.tableView.scrollEnabled = NO;
7677
self.tableView.backgroundColor = self.contentViewBackgroundColor;
7778
self.tableView.layer.cornerRadius = self.contentViewCornerRadius;

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ you can customize everything
9797
*/
9898
@property (nonatomic, assign) BOOL isShowArrow;
9999
100+
/**
101+
* the separator line color of each item, default is light grey (r:0.93,g:0.93,b:0.93)
102+
*/
103+
@property (nullable, nonatomic, strong) UIColor *itemSeparatorLineColor;
100104
```
101105

102106
### Licence

0 commit comments

Comments
 (0)