Discussion Forums  >  Uncategorized

Replies: 5    Views: 313

Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
06/09/11 02:07 PM (14 years ago)

Refresh button in (top ) navbar is not refreshing

Hi. I want to use upper navbar in my new app. Here I want to have to buttons. The one to the right to refresh the screen ( in this case it's a custom url), the other button to the left will be a back button, so the user can get back after clicking on the content that will lead the user to a website. The problem here is that the refresh function that I choose in the dropdown meny is not reacting at all. It's there but no reaction at all. I know that I can use the bottom navbar for this purpose but I really want to use the upper nav bar since its more coherent with the design and style the new app have. v 1.5 iphone /Stefan
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
06/09/11 02:34 PM (14 years ago)
HI Stefan, did you select a screen to open with the refresh button (it's the box below the choose what type of right button) the right button is there to navigate to another screen...i don't believe it will work as a standalone refresh button
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
06/09/11 02:46 PM (14 years ago)
Yes. I did that so it pointed back to the same page. But that is not a what I will call divine solution. Furthermore, when the user click on the back button a transition action will occur that is not motivated so the refresh is more of a send me back-again but this time kind of ugly. The future app owner would probably smack me on the top of my head if I present that to him. :) I'm looking at the code in xcode in order to try to move/copy the functions from the bottom navbar to the upper one. I only need this in this app. I hope it's not a rocket science project. BR/Stefan
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
06/10/11 06:17 PM (14 years ago)
The refresh choice in the drop-down is not a 'Refresh Function' it is only the type of button that appears. So, if the refresh button is appearing this is working. Next, like @ ianjamespiano mentioned, the software expects a screen to load when that button is tapped. And, like you said, this is not idea. So...I'll assume you can't make use of the Show Browser Refresh option in the Adanced Settings. I guess because you don't want a bottom toolbar? If this is the case, OK. What you'll need to do is 'overload' the right-button method in this screen so it doesn't perform the default action. The action that gets called normally is called navRightTap and it lives in the BT_Layout > BT_viewConroller.m file. We are not changing that, we are creating a new version of it in one class file, this is called Overloading in programming speak. a) Find BT_Screens > BT_screen_webView.m b) Add method call navRightTap like this: //right button -(void)navRightTap{ [self refreshData] } c) Recompile. This will do a screen-refresh on that screen with ANY right button type. It does not matter what type of button you choose in the control panel to display, it will do this everytime. This means that if you have a different Custom URL screen, and you want a DIFFERENT type of behavior for that screen, the method will need to detect the screen id before refreshing. In short hand... if(the screen id = my screen to refresh){ [self refreshData]; }else{ [BT_viewControllerManager handleRightButton:self.screenData]; }
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
06/11/11 10:56 AM (14 years ago)
Fantastic! It took me a while to find out that the missing ; was the thing that made it impossible to recompile. But now all is good in the app. I owe you and the team many many thanks. You should get paypal or something so that we can support you guys for this amazing support and help you give us all. Until then one million thanks and oh...I throw in som hugs also - for free ;) BR/Stefan
 
Stefan
buzztouch Evangelist
Profile
Posts: 558
Reg: Dec 21, 2010
Sweden
14,780
like
06/11/11 11:27 AM (14 years ago)
Oh! I just realise I need a back button up to the left. Bummer. All tips will be greatly taken care of. /Stefan
 

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.