#import "rootTableViewController.h"
@interface rootTableViewController ()
@property(strong,nonatomic)NSArray *arrTitle;
@property(strong,nonatomic)NSArray *arrImage;
@end
@implementation rootTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title=@"我";
self.navigationController.navigationBar.backgroundColor=[UIColor blackColor];
self.arrTitle=@[@"相册",@"收藏",@"钱包",@"卡包"];
self.arrImage=@[@"MoreMyAlbum@2x.png",@"MoreMyFavorites@2x.png",@"MoreMyFavorites@2x.png",@"PayCarddetailVirtualIcon.png"];
[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"mycell"
];
self.tableView.scrollEnabled=NO;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 4;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section==0) {
return 1;
}
else if (section==1){
return 4;
}
else
{
return 1;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellInent=@"mycell";
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellInent forIndexPath:indexPath];
if (indexPath.section==0) {
cell.textLabel.numberOfLines=2;
cell.textLabel.text=@"XXX \r\n微信号:11361189";
cell.imageView.image=[UIImage imageNamed:@"a.jpeg"];
UIImage *im=[UIImage imageNamed:@"add_friend_myQR"];
UIButton *button=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, im.size.width, im.size.height)];
[button setImage:im forState:UIControlStateNormal];
cell.accessoryView=button;
}
else if (indexPath.section==1)
{
cell.textLabel.text=self.arrTitle[indexPath.row];
cell.imageView.image=[UIImage imageNamed:self.arrImage[indexPath.row]];
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
}
else if (indexPath.section==2)
{
cell.textLabel.text=@"表情";
cell.imageView.image=[UIImage imageNamed:@"MoreExpressionShops"];
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
}
else
{
cell.textLabel.text=@"设置";
cell.imageView.image=[UIImage imageNamed:@"MoreSetting"];
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
}
return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section==0) {
return 100.0;
}else
{
return 40.0;
}
屏幕快照 2016-03-17 下午10.10.16.png