UITableview界面

#import "fiveViewController.h"

#import "SZViewController.h"

@interface fiveViewController ()<UITableViewDelegate,UITableViewDataSource>

{

    UITableView *tbv;

}

@end

@implementationfiveViewController

- (void)viewDidLoad {

    [super viewDidLoad];

    // Do any additional setup after loading the view.

    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"aa"] style:UIBarButtonItemStylePlain target:self action:nil];

    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"bb"] style:UIBarButtonItemStylePlain target:self action:@selector(click)];


    tbv = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];

    tbv.dataSource = self;

    tbv.delegate=self;

    [self.view addSubview:tbv];


}

- (void)click{

    [self.navigationController pushViewController:[SZViewController new] animated:YES];

}

-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{

    return 5;

}

-(NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section{

    if(section==0) {

        return 1;

    }elseif(section==1){

        return 1;

    }elseif(section==2){

        return 1;

    }elseif(section==3){

        return 1;

    }else{

        return 1;

    }

}

-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{


    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"2"];

    if(!cell) {

        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"2"];

    }

    if(indexPath.section==0) {

        tbv.rowHeight=150;

        cell.backgroundColor= [UIColor redColor];


        UIView *uiv = [[UIView alloc]initWithFrame:CGRectMake(0,0,self.view.frame.size.width,150)];

        UIImageView  *ima = [[UIImageView alloc]initWithFrame:CGRectMake(20,40,100,100)];

        ima.image= [UIImage imageNamed:@"1"];

        ima.layer.masksToBounds= YES;

        ima.layer.cornerRadius = 50;

        [uiv addSubview:ima];

        [cell addSubview:uiv];


        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(130,90,150,50)];

        label.text=@"谎言";

        [cell addSubview:label];


        UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(280,90,150,50)];

        label2.text=@"成长值2>";

        [cell  addSubview:label2];

    }else  if(indexPath.section==1){

        tbv.rowHeight=150;


        UILabel *label3 = [[UILabel alloc]initWithFrame:CGRectMake(20,0,150,50)];

        label3.text=@"我的订单";

        [cell addSubview:label3];


        UILabel *label4 = [[UILabel alloc]initWithFrame:CGRectMake(250,0,200,50)];

        label4.text=@"查看全部订单>";

        [cell addSubview:label4];


        UIImageView  *ima5 = [[UIImageView alloc]initWithFrame:CGRectMake(28,60,50,50)];

        ima5.image= [UIImage imageNamed:@"11"];

        ima5.layer.masksToBounds = YES;

        ima5.layer.cornerRadius=25;

        [cell addSubview: ima5];


        UILabel  *lab5 = [[UILabel alloc]initWithFrame:CGRectMake(30,110,60,20)];

        lab5.text=@"当前订单";

        lab5.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab5];


        UIImageView  *ima6 = [[UIImageView alloc]initWithFrame:CGRectMake(128,60,50,50)];

        ima6.image= [UIImage imageNamed:@"11"];

        ima6.layer.masksToBounds = YES;

        ima6.layer.cornerRadius=25;

        [cell addSubview: ima6];


        UILabel  *lab6 = [[UILabel alloc]initWithFrame:CGRectMake(130,110,60,20)];

        lab6.text=@"当前订单";

        lab6.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab6];


        UIImageView  *ima7 = [[UIImageView alloc]initWithFrame:CGRectMake(228,60,50,50)];

        ima7.image= [UIImage imageNamed:@"11"];

        ima7.layer.masksToBounds = YES;

        ima7.layer.cornerRadius=25;

        [cell addSubview: ima7];


        UILabel * lab7 = [[UILabel alloc]initWithFrame:CGRectMake(230,110,60,20)];

        lab7.text=@"当前订单";

        lab7.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab7];


        UIImageView * ima8 = [[UIImageView alloc]initWithFrame:CGRectMake(328,60,50,50)];

        ima8.image= [UIImage imageNamed:@"11"];

        ima8.layer.masksToBounds = YES;

        ima8.layer.cornerRadius=25;

        [cell addSubview: ima8];


        UILabel  *lab8 = [[UILabel alloc]initWithFrame:CGRectMake(330,110,60,20)];

        lab8.text=@"当前订单";

        lab8.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab8];


    }else if(indexPath.section==2){


        tbv.rowHeight=130;


        UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(10,0,150,50)];

        label.text=@"我的钱包";

        [cell addSubview:label];


        UILabel  *label2 = [[UILabel alloc]initWithFrame:CGRectMake(47,50,100,50)];

        label2.text=@"0元";

        [cell addSubview:label2];


        UILabel *label3 = [[UILabel alloc]initWithFrame:CGRectMake(20,80,100,50)];

        label3.text=@"可用余额";

        [cell addSubview:label3];


        UILabel *label4 = [[UILabel alloc]initWithFrame:CGRectMake(145,50,100,50)];

        label4.text=@"0";

        [cell addSubview:label4];


        UILabel *label5 = [[UILabel alloc]initWithFrame:CGRectMake(134,80,100,50)];

        label5.text=@"贝币";

        [cell addSubview:label5];


        UILabel *label6 = [[UILabel alloc]initWithFrame:CGRectMake(220,50,100,50)];

        label6.text=@"0张";

        [cell addSubview:label6];


        UILabel *label7 = [[UILabel alloc]initWithFrame:CGRectMake(210,80,100,50)];

        label7.text=@"优惠券";

        [cell addSubview:label7];


        UILabel *label8 = [[UILabel alloc]initWithFrame:CGRectMake(300,50,100,50)];

        label8.text=@"0万元";

        [cell addSubview:label8];


        UILabel *label9 = [[UILabel alloc]initWithFrame:CGRectMake(290,80,100,50)];

        label9.text=@"可借现金";

        [cell addSubview:label9];

    }else if(indexPath.section==3){


        tbv.rowHeight = 200;


        UIImageView  *ima = [[UIImageView alloc]initWithFrame:CGRectMake(20,10,50,50)];

        ima.image= [UIImage imageNamed:@"11"];

        ima.layer.masksToBounds = YES;

        ima.layer.cornerRadius = 25;

        [cell addSubview: ima];


        UILabel  *lab = [[UILabel alloc]initWithFrame:CGRectMake(24,65,60,20)];

        lab.text=@"当前订单";

        lab.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab];


        UIImageView  *ima2 = [[UIImageView alloc]initWithFrame:CGRectMake(120,10,50,50)];

        ima2.image= [UIImage imageNamed:@"22"];

        ima2.layer.masksToBounds = YES;

        ima2.layer.cornerRadius=25;

        [cell addSubview: ima2];


        UILabel *lab2 = [[UILabel alloc]initWithFrame:CGRectMake(124,65,60,20)];

        lab2.text=@"代付款";

        lab2.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab2];


        UIImageView *ima3 = [[UIImageView alloc]initWithFrame:CGRectMake(220,10,50,50)];

        ima3.image= [UIImage imageNamed:@"33"];

        ima3.layer.masksToBounds = YES;

        ima3.layer.cornerRadius=25;

        [cell addSubview: ima3];


        UILabel *lab3 = [[UILabel alloc]initWithFrame:CGRectMake(224,65,60,20)];

        lab3.text=@"当前订单";

        lab3.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab3];


        UIImageView  *ima4 = [[UIImageView alloc]initWithFrame:CGRectMake(320,10,50,50)];

        ima4.image= [UIImage imageNamed:@"44"];

        ima4.layer.masksToBounds = YES;

        ima4.layer.cornerRadius=25;

        [cell addSubview: ima4];


        UILabel *lab4 = [[UILabel alloc]initWithFrame:CGRectMake(324,65,60,20)];

        lab4.text=@"当前订单";

        lab4.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab4];


        UIImageView *ima5 = [[UIImageView alloc]initWithFrame:CGRectMake(20,100,50,50)];

        ima5.image= [UIImage imageNamed:@"11"];

        ima5.layer.masksToBounds = YES;

        ima5.layer.cornerRadius=25;

        [cell addSubview: ima5];


        UILabel *lab5 = [[UILabel alloc]initWithFrame:CGRectMake(24,155,60,20)];

        lab5.text=@"当前订单";

        lab5.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab5];


        UIImageView *ima6 = [[UIImageView alloc]initWithFrame:CGRectMake(120,100,50,50)];

        ima6.image= [UIImage imageNamed:@"22"];

        ima6.layer.masksToBounds = YES;

        ima6.layer.cornerRadius=25;

        [cell addSubview: ima6];


        UILabel  *lab6 = [[UILabel alloc]initWithFrame:CGRectMake(124,155,60,20)];

        lab6.text=@"代付款";

        lab6.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab6];


        UIImageView  *ima7 = [[UIImageView alloc]initWithFrame:CGRectMake(220,100,50,50)];

        ima7.image= [UIImage imageNamed:@"33"];

        ima7.layer.masksToBounds = YES;

        ima7.layer.cornerRadius=25;

        [cell addSubview: ima7];


        UILabel *lab7 = [[UILabel alloc]initWithFrame:CGRectMake(224,155,60,20)];

        lab7.text=@"当前订单";

        lab7.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab7];


        UIImageView *ima8 = [[UIImageView alloc]initWithFrame:CGRectMake(320,100,50,50)];

        ima8.image= [UIImage imageNamed:@"44"];

        ima8.layer.masksToBounds = YES;

        ima8.layer.cornerRadius=25;

        [cell addSubview: ima8];


        UILabel  *lab8 = [[UILabel alloc]initWithFrame:CGRectMake(324,155,60,20)];

        lab8.text=@"当前订单";

        lab8.font= [UIFont systemFontOfSize:10];

        [cell addSubview:lab8];

    }

    return cell;


}

@end

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,776评论 6 496
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,527评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 160,361评论 0 350
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,430评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,511评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,544评论 1 293
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,561评论 3 414
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,315评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,763评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,070评论 2 330
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,235评论 1 343
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,911评论 5 338
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,554评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,173评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,424评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,106评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,103评论 2 352

推荐阅读更多精彩内容