0
我用真棒ECSildingViewController 2.0创建了我的应用程序。但是当我发现右侧菜单上的UITableViewCell无法显示图标时。它在左侧菜单上效果很好。请在这里找到截图:ECSlidingController 2右侧菜单图标丢失
http://i.imgur.com/KxtOlJE.png
http://i.imgur.com/wAdPDPK.png
- (NSArray *)menuItems {
if (_menuItems) return _menuItems;
_menuItems = @[@"Item 1",@"Item 2"];
_menuIcons = @[@"play.png",@"heart.png"];
return _menuItems;
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.menuItems.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"MenuCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSString *menuItem = self.menuItems[indexPath.row];
NSString *menuIcon = self.menuIcons[indexPath.row];
cell.textLabel.text = menuItem;
cell.imageView.image = [UIImage imageNamed:menuIcon];
[cell setBackgroundColor:[UIColor clearColor]];
return cell;
}
它看起来像一个对齐问题。在第二张图片中注意,搜索栏的一部分位于中央视图下方。尝试调整anchorLeftPeekAmount和anchorLeftRevealAmount。 –
Thx很多尼尔。我发现anchorLeftPeekAmount和anchorLeftRevealAmount都很好。 因此,我将UITableView的宽度从320减少到276(anchorLeftPeekAmount默认为44)。那么它显示正确! – user1172579