我目前在UITableView上面添加UIView。它的工作原理,但看起來像空的UITableViewCell的下方會出現這樣的:在UITableView上面添加UIView
還有就是我的第二個觀點(.m文件)的代碼:
-(id)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
NSLog(@"Calld");
self.backgroundColor = [UIColor whiteColor];
[self addLabel];
return self;
}
-(void)addLabel{
UILabel *fromLabel = [[UILabel alloc]initWithFrame:CGRectMake(8, 220, 304, 128)];
fromLabel.text = @"(Щелкните на экран, чтобы добавить задачи)";
fromLabel.numberOfLines = 3;
fromLabel.baselineAdjustment = UIBaselineAdjustmentAlignBaselines; // or UIBaselineAdjustmentAlignCenters, or UIBaselineAdjustmentNone
fromLabel.adjustsFontSizeToFitWidth = YES;
fromLabel.adjustsLetterSpacingToFitWidth = YES;
fromLabel.minimumScaleFactor = 10.0f/12.0f;
fromLabel.clipsToBounds = YES;
fromLabel.backgroundColor = [UIColor clearColor];
fromLabel.textColor = [UIColor blackColor];
fromLabel.textAlignment = NSTextAlignmentLeft;
[self addSubview:fromLabel];
}
及主要觀點:
InitialView *initView = [[InitialView alloc]initWithFrame:[[UIScreen mainScreen] bounds]];
[self.view addSubview:initView];
如何刪除該空行,然後刪除視圖並再次顯示錶?