There are several ways to do this. If you have a custom view that has a custom location, you can change it as follows:
Create an instance of var :
UIView* backgroundView;
And whenever you need it, put it on your own look:
if (backgroundView == nil) backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.height, [UIScreen mainScreen].bounds.size.width)]; backgroundView.backgroundColor = [[UIColor grayColor] colorWithAlphaComponent:.5f]; [self.view addSubview:backgroundView]; [backgroundView animateBump:customView.view]; [backgroundView addSubview:customView.view];
If you donβt need it anymore
[backgroundView removeFromSuperview]
giuseppe Dec 05 '13 at 11:55 on 2013-12-05 11:55
source share