Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 8    Views: 92

MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
06/19/12 03:28 PM (13 years ago)

Quiz Help Needed With Bottom Toolbar

I'm building an app that has multiple quizzes and I'm running into an issue. Hoping someone here can help solve. My first quiz works great. It hides the bottom tab bar. At the end of the first quiz, if the player gets a certain score, they get a "Reward Screen" which is a custom html congratulating them. Even if I set the Bottom Tab Bar to "No, do not hide the tab bar," it remains hidden. The reward screen has a "Next" button in the upper right of the Navigation Bar that launches Quiz two. Quiz Two functions well with the tab bar hidden. My problem is, that if the user quits quiz two using the back button, or completes the quiz and uses the "quit" button at the end, they are returned to the Congratulations Reward Screen, but there is NO TAB BAR at the bottom. Can't figure out how to get the tab bar to reappear on the Reward Screen. Anyone worked this out before?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
06/19/12 05:24 PM (13 years ago)
Can you have the "next" button on the reward screen go to a list menu or button menu with one list item going to the next quiz? Not sure if having this middle-man would help, but it might be worth a try.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/19/12 05:44 PM (13 years ago)
I had the reward screen as a button menu originally and had the same issue, but adding one more screen may be worth a shot. Thanks! I'll let you know.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/19/12 10:24 PM (13 years ago)
Ah, I think I know what's happening. As you move "forward" screen by screen, the app is doing a UINavigationController "push" view controller. This is the method that allows the dev. to hide the tab bar. With each move forward, the show / hide should work. Moving back is a different story. When you go back, or "pop" the view off the top of the stack (the UINavigationController maintains a stack of screens, they are added to this when you push new screens) iOS is "remembering" the state of the previous screen. In other words, it's not re-building the screen each time. This is it's way of saving memory. It sounds to me like it has remembered (correctly) that the tab bar was hidden. But, we now want it to show again. I'm not sure if this is possible or not. Wrong word, anything's possible I'm just not sure how to pull it off yet. I'll do some digging. Please re-post if I have this wrong so I don't dig around aimlessly trying to re-create something I've misunderstood.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/19/12 10:47 PM (13 years ago)
David, you are correct. I tried to use a similar return like what's used in the pop up with options for scoreboard, quit, etc. In that pop up, The quit option returns the user to the previous screen and restores the tab bar. I've been unable to get that function to work on the second screen. I'm sure your analysis is right as far as cause.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/19/12 11:23 PM (13 years ago)
Could this work... a) User sees Reward Screen as expected. So far so good. b) User takes next quiz with right-nav-bar button at top of Reward Screen. At this point, going "back" would produce the Reward Screen again. This seem problematic to me. They have already seen the reward screen and should probably not see it again. Just a hunch about the design. It seems to me that the "back" button on quiz two would take them to some sort of menu or starting screen, probably the same screen they were on when they started quiz 1. Idea one: Instead of showing the Reward Screen screen with the back or quit button on quiz two, do a popToRootViewController to return them to the "beginning" of the sequence. You would do this in the navLeftTap() method. Idea two: Look at the BT_viewControllerManager.m file. This is the file that hides the tab bar when a new screen is pushed onto the navigation stack. The method that handles the loading of the next screen is called handleTapToLoadScreen. It's a very long method. Look down to about line 549 where it does: [theNextViewController setHidesBottomBarWhenPushed:hideBottomBar]; You could manipulate this differently depending on which screen is being loading. Example, in pseudo code for readability... "If the screen that is showing has id of 999 then show the tab bar, else, hide it" You can test to see what screen is being loaded by grabbing the itemId (or nickname, or type, or whatever) from the JSON data. Remember, in this long method, the handleTapToLoadScreen method knows which screen is coming and going. Both sets of JSON data are available in this method making it easier to change the behavior as necessary.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
06/30/12 08:44 AM (13 years ago)
@David - Thanks David. Put this one on hold while I finished up another project. Will give this a shot this week.
 
MGoBlue
Apple Fan
Profile
Posts: 980
Reg: Jun 07, 2011
Gold River, CA
10,600
like
07/06/12 07:55 AM (13 years ago)
@David - found a very simple solution. In the actions for the "quit" button following a quiz, I changed [self navLeftTap]; to [self.navigationController popToRootViewControllerAnimated:YES]; After any quiz, the quit button pops the user back to screen that launches the first quiz and reloads the tab bar. Here's the scheme: quiz 1 -> reward screen 1 -> quiz 2 -> reward screen 2 -> quiz 3 -> reward screen 3, etc. My reward screens are simple custom html pages. They display a "back" button (which retriggers the continue/submit score/quit popup) and a "next" button which launches the next quiz in order. Simple!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
07/06/12 02:44 PM (13 years ago)
Genius! Added to the list of tricks :-)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.