zoukankan      html  css  js  c++  java
  • iOS UI 07 uitableview

    //

    //  RootViewController.m

    //  ui - 07

    //

    //  Created by dllo on 15/11/18.

    //  Copyright (c) 2015 dllo. All rights reserved.

    //


    #import "RootViewController.h"


    @interface RootViewController () <UITableViewDataSource, UITableViewDelegate>


    @end


    @implementation RootViewController


    - (void)viewDidLoad {

        [super viewDidLoad];

        self.view.backgroundColor = [UIColor whiteColor];

        

        

        UITableView *table = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain];

        table.delegate = self;

        table.dataSource = self;

        [self.view addSubview:table];

        [table release];

        

        

        

        

        

        

        

        

        

        // Do any additional setup after loading the view.

    }






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

    {

        static NSString *cellstr = @"cell";

        UITableViewCell *Cell = [tableView dequeueReusableCellWithIdentifier:cellstr];

        if (nil == Cell) {

            Cell = [[[UITableViewCell alloc]initWithStyle:   UITableViewCellStyleValue1 reuseIdentifier:cellstr] autorelease];

    //            Cell.textLabel.text = @"18733324546";

                Cell.imageView.image =[UIImage imageNamed:@"1.png"];

            

        }

        if (1 == indexPath.section && 0 == indexPath.row) {

            Cell.textLabel.text = @"大哥";

            Cell.detailTextLabel.text = @"138847";

        }

        

            return Cell;

    }

    - (void)didReceiveMemoryWarning {

        [super didReceiveMemoryWarning];

        // Dispose of any resources that can be recreated.

    }

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

    {

        return 5;

    }

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

    {

        return 3;

    }

    - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

    {

        if (section == 0) {

            return @"A";

        }

        if (section == 1) {

            return @"B";

        }

        return @"c";

    }

    /*

    #pragma mark - Navigation


    // In a storyboard-based application, you will often want to do a little preparation before navigation

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

        // Get the new view controller using [segue destinationViewController].

        // Pass the selected object to the new view controller.

    }

    */


    @end


  • 相关阅读:
    FPGA基础学习(2) -- FIFO IP核(Quartus)
    FPGA中如何实现除法?
    GPIO初始化之PB3/PB4/PA13/PA14/PA15引脚的复用--寄存器版本
    图像处理实际应用启发
    霍夫变换(hough transform)
    傅里叶变换讲解
    模拟电路学习入门的建议(综合整理)
    低噪声APD偏置电路
    如何安装altium designer 10
    后仿真
  • 原文地址:https://www.cnblogs.com/yuhaojishuboke/p/5043084.html
Copyright © 2011-2022 走看看