美文网首页
tableView界面当无数据时显示为一个ImageView

tableView界面当无数据时显示为一个ImageView

作者: 灰客 | 来源:发表于2017-06-06 12:01 被阅读0次

http://www.jianshu.com/p/a196e97e4bef
设置内容
_tableView.backgroundColor= [UIColor clearColor];

UIView * view = [[UIView alloc]initWithFrame:self.view.frame];

UIImageView*imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"dahuizhaiyao_tubiao150"]];
imageView.frame = CGRectMake((SCREEN_WIDTH - flexibleWidth(150))/2.0f, flexibleHeight(120), flexibleWidth(150), flexibleHeight(150));
[view addSubview:imageView];
_tableView.backgroundView = view;

数据请求成功里面
if (_dataArray.count > 0) {
_tableView.backgroundView.hidden = YES;
}

相关文章

网友评论

      本文标题:tableView界面当无数据时显示为一个ImageView

      本文链接:https://www.haomeiwen.com/subject/xzugfxtx.html