zoukankan      html  css  js  c++  java
  • UITableView自定义Section

    - (UIView *)tableView:(UITableView *)tableView 

    viewForHeaderInSection:(NSInteger)section

    {

        UIView *headerView = [[UIViewalloc] initWithFrame:CGRectMake(10, 0, 300, 30)];//创建一个视图  

        UIImageView *headerImageView = [[UIImageViewalloc] initWithFrame:CGRectMake(10, 0, 300, 30)];

        UIImage *image = [UIImageimageNamed:@"4-2.png"];

        [headerImageView setImage:image];

        [headerView addSubview:headerImageView];

        [headerImageView release];

        UILabel *headerLabel = [[UILabelalloc] initWithFrame:CGRectMake(130, 5, 150, 20)];

        headerLabel.backgroundColor = [UIColorclearColor];

        headerLabel.font = [UIFontboldSystemFontOfSize:15.0];

        headerLabel.textColor = [UIColorblueColor];

        headerLabel.text = @"Section";

        [headerView addSubview:headerLabel];

        [headerLabel release];

        

        return headerView;

    }//自定义section的头部

  • 相关阅读:
    MySQL教程22-字符串类型
    MySQL教程21-日期和时间类型
    MySQL教程20-小数类型
    MySQL教程19-整数类型
    MySQL教程18-数据类型简介
    ActiveMQ_topic
    ActiveMQ_消费者编码
    ActiveMQ_生产者编码
    ActiveMQ介绍
    管理docker容器
  • 原文地址:https://www.cnblogs.com/hellocby/p/2513379.html
Copyright © 2011-2022 走看看