0

I have an app with an UINavigationController and two tableviews. When I switch between these two table views, I would like the background to remain static, so it doesn't change, but I don't have a clue on how to do this.

I was thinking of making the background of the two table views transparent and to add a UIViewController behind then with the desired static image as background. Is that a right approach? Or are there better or easier solutions? I'm working with storyboards btw.

Thanks in advance!

1 Answer 1

1

If you're into animation, a frame change ain't all that bad to code out. You could use a transparent background for the table, and insert an image view behind the two tables:

[UIView animateWithDuration:1.0f animations:^{ [self.tableOne setFrame:CGRectMake(-320,0,self.view.frame.size.width, self.view.frame.size.height)]; [self.tableTwo setFrame:CGRectMake(0,0,self.view.frame.size.width, self.view.frame.size.height)]; }]; 

Of course frame is just one option. Center works as well.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your response but I've barely worked with animations and I don't know very much about how to implement then. Is there another easier way to do this?
Honestly, no. This is infinitely easier than view controller containment.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.