点击一个按钮之后,在window上添加一个透明的背景,在透明的背景上添加一个tabview,
运行时直接崩溃了,也没有错误信息提示,下面是我的代码,求大神们帮忙看看啊
#import "FontSizeView.h"
@interface FontSizeView()
@property (nonatomic, strong)UIView *backGround;
@property (nonatomic, strong)UITableView *fontTableView;
@implementation FontSizeView
- (void)showFontSize {
//窗口
UIWindow * window = [[[UIApplication sharedApplication] windows] lastObject];
//透明背景
_backGround = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
_backGround.backgroundColor = [UIColor blackColor];
_backGround.alpha = 0.5;
//字体大小选择
_fontTableView = [[UITableView alloc]initWithFrame:CGRectMake(SCREE_WIDTH/6 ,SCREE_HEIGHT/3, SCREE_WIDTH*2/3, SCREE_HEIGHT/3)];
_fontTableView.dataSource = self;
_fontTableView.delegate = self;
_fontTableView.backgroundColor = [UIColor blueColor];
[_backGround addSubview:_fontTableView];
[window addSubview:_backGround];
}
#pragma mark - UITableViewDataSource
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 1;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath {
static NSString *cellID = @"cellIdentify";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:cellID];
}
return cell;
}
@end