码迷,mamicode.com
首页 > 其他好文 > 详细

透明的UITableView

时间:2018-04-23 13:49:57      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:div   png   span   bounds   war   .text   ack   eva   AC   

技术分享图片

 

//
//  ViewController.m
//  透明table
//
//  Created by LiuWei on 2018/4/23.
//  Copyright ? 2018年 xxx. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic,strong)UITableView *table;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UIImageView *imgV = [[UIImageView alloc]initWithFrame:self.view.bounds];
    imgV.image = [UIImage imageNamed:@"005.jpg"];
    [self.view addSubview:imgV];
    
    UITableView *table = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    table.delegate = self;
    table.dataSource = self;
    _table = table;
    _table.backgroundColor = [UIColor clearColor];

    [self.view addSubview:_table];
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 20;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cellID"];
    cell.textLabel.text = @"haha";
    cell.backgroundColor = [UIColor clearColor];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end

 

透明的UITableView

标签:div   png   span   bounds   war   .text   ack   eva   AC   

原文地址:https://www.cnblogs.com/liuw-flexi/p/8918557.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!