我試圖在UIVisualEffectView
上添加UItableview
。我已經編寫類似下面使用Objective C在UIVisualEffectView上添加UItableview
// MainView
Mainview = [[UIView alloc] init];
[self.view addSubview:Mainview];
blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
[visualEffectView setFrame:self.view.bounds];
[self.view addSubview:visualEffectView];
table = [[UITableView alloc]init];
table.scrollEnabled = YES;
table.allowsSelection = YES;
table.dataSource = self;
table.delegate = self;
table.showsVerticalScrollIndicator = YES;
table.userInteractionEnabled = YES;
table.bounces = YES;
[table setBackgroundView:nil];
[table setOpaque:NO];
[table setContentInset:UIEdgeInsetsMake(1.0, 0.0, 0.0, 0.0)];
[table setContentOffset:CGPointMake(0,500) animated:YES];
[visualEffectView.contentView addSubview: table];
每當我scrolling tableview
突然UIVisualEffectView
躲藏。沒有什麼error
我曾經遇到過。我需要建立穩定的UIVisualEffectView
。
你是否想讓桌面背景模糊或者單元格模糊? – Mukesh