我有一个从右侧的幻灯片菜单,我想定制有图标,而不是文本标签。iOS的幻灯片菜单与图像
我有SlideNavigationController.m和SlideNavigationController.h
在MenuViewController.h我有:
#import <UIKit/UIKit.h>
#import "SlideNavigationController.h"
@interface MenuViewController : UIViewController <UITableViewDelegate>
@property (nonatomic, strong) NSString *cellIdentifier;
@end
在MenuViewController.m我有:
#import "MenuViewController.h"
@implementation MenuViewController
@synthesize cellIdentifier;
#pragma mark - UITableView Delegate & Datasrouce -
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection (NSInteger)section
{
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:self.cellIdentifier];
switch (indexPath.row)
{
case 0:
cell.imageView.image = [UIImage imageNamed:@"Maps-icon.png"];
break;
case 1:
cell.textLabel.text = @"Yellow";
break;
case 2:
cell.textLabel.text = @"Orange";
break;
}
return cell;
}
对于每个情况 (例如,案例0: cell.imageView.image = [UIImage imageNamed:@“Maps-icon.png”]; 我想将图像放在单元格的最右侧,因为这是幻灯片动画中显示的内容。我该如何改变图像的位置?
在此先感谢。
我面临同样的问题;你能告诉我你是如何解决这个问题的吗?谢谢 – Sonic