iOS: Place UIView on top of UITableView in fixed position

后端 未结 5 2206
广开言路
广开言路 2020-12-04 13:13

I need to put a UIView (for ads) on top of a UITableView in my iphone app. The problem is that when I scroll the table to the bottom the added UIView is scrolling with the

5条回答
  •  生来不讨喜
    2020-12-04 13:19

    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        footerView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT-64, SCREEN_WIDTH, 64)];
        footerView.backgroundColor = [UIColor blueColor ];
        [self.navigationController.view addSubview:footerView];
    }   
    
    - (void)dealloc
    {
        [footerView removeFromSuperview];
    }
    

提交回复
热议问题