iOS tableView~尾部添加控件

//联系人:石虎QQ:1224614774昵称:嗡嘛呢叭咪哄

/**

注意:在cell的最后一行添加文案

*/

一、效果图:

二、代码实现

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section

{

//底部文案

CGFloat bottomViewH =30;

UIView *bottomView = [[UIView alloc]initWithFrame:CGRectMake(0,self.view.bounds.size.height -80,OK_SCREEN_WIDTH, bottomViewH)];

if(section ==0) {

bottomView.backgroundColor = [UIColor clearColor];

}else{

bottomView.backgroundColor = OKColorRGBA(188,154,99,0.1);

}

[self.view addSubview:bottomView];

//文案

UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0,8,0,0)];

titleLabel.font = kGlobalFontSize_13;

titleLabel.text =@"八方贵金属合作机构均有国家监管保障";

titleLabel.textAlignment = NSTextAlignmentCenter;

[titleLabel sizeToFit];

titleLabel.ok_centerX =self.view.ok_centerX;

titleLabel.textColor = kGlobalButtonYellow;

[bottomView addSubview:titleLabel];

//图片

UIImageView *LeftImage = [[UIImageView alloc] initWithFrame:CGRectMake(titleLabel.mj_x-20,8, titleLabel.ok_height, titleLabel.ok_height)];

LeftImage.image = [UIImage imageNamed:@"img_shield_shield"];

[bottomView addSubview:LeftImage];

returnbottomView ;

}

谢谢!!!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • CIDetector 这个api是苹果在ios8之后提供的。所以用苹果自带的AVFundation扫描,如果从相册...
    然亦伞阅读 576评论 1 0
  • 实现自定义分段控件 相关属性声明 封装初始化类方法。调用初始化方法传入参数:需要设定的整个控件的frame 以及 ...
    WeiHing阅读 6,707评论 0 8
  • 今天一下子告别两位朋友,当时在忙,接到电话的时候正在陪客户洽谈。 说是洽谈,实际上就是两个人坐在那里你一根我一根的...
    宁无言阅读 232评论 0 0
  • 823fdd1d51c4阅读 54评论 0 0
  • 引言 我们总是这样,把最好的脾气留给朋友。把最差的心情交给父母。陈奕迅有首歌《好久不见》“我多么想和你再见一面,看...
    凡夫俗子y阅读 653评论 20 18