Skip to content

Commit

Permalink
修复已知的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lyb5834 committed Nov 9, 2016
1 parent ac293dc commit 5da3f9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Binary file not shown.
6 changes: 4 additions & 2 deletions YBPopupMenuDemo/YBPopupMenu/YBPopupMenu.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ - (instancetype)initWithTitles:(NSArray *)titles
if (delegate) self.delegate = delegate;

self.width = itemWidth;
self.height = titles.count * kButtonHeight + 2 * kArrowHeight;
self.height = (titles.count > 5 ? 5 * kButtonHeight : titles.count * kButtonHeight) + 2 * kArrowHeight;

kArrowPosition = 0.5 * self.width - 0.5 * kArrowWidth;

Expand All @@ -201,7 +201,7 @@ - (instancetype)initWithTitles:(NSArray *)titles
_contentView = [[UITableView alloc] initWithFrame: _mainView.bounds style:UITableViewStylePlain];
_contentView.delegate = self;
_contentView.dataSource= self;
_contentView.bounces = NO;
_contentView.bounces = titles.count > 5 ? YES : NO;
_contentView.tableFooterView = [UIView new];
_contentView.separatorStyle = UITableViewCellSeparatorStyleNone;
_contentView.height -= 2 * kArrowHeight;
Expand Down Expand Up @@ -292,6 +292,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}else {
cell.imageView.image = nil;
}
}else {
cell.imageView.image = nil;
}
return cell;
}
Expand Down

0 comments on commit 5da3f9a

Please sign in to comment.