7 Replies Latest reply on Jul 8, 2014 2:09 AM by Jochem Pouwels

    Still no decent tabbar in rhomobile?

    Jochem Pouwels

      Im just curious, has anyone found a fix for preloading tabs in rhomobile?

      The current tabbar always:

       

      -Show a blank page after the splashscreen before first tab loads

      -Show a blank page after a tabbar click.

       

      All this could be fixed by preloading the views in the tabs. Has anyone found a way to do this?

       

      It really is pretty ugly for the user to constantly look at blank pages..

        • Re: Still no decent tabbar in rhomobile?

          This can be done when the tab is created, under the 'parameters' section of the create method here: Rhomobile | NativeTabbar

           

          createOnInit : BOOLEANDefault: false

          Create tab immediately when TabBar is created. Action also will be executed. If false, the tab will be created when it is switched to.

           

          Brian

            • Re: Still no decent tabbar in rhomobile?
              Jochem Pouwels

              The docs says it will only work for Windows Mobile.

              I need this for android and iOs too..

               

              any workarounds maybe?

                • Re: Still no decent tabbar in rhomobile?

                  Unfortunately this is only available for windows mobile. The closest you can get on other platforms is to use the current view in the new tab:

                  • useCurrentViewForTab : BOOLEANDefault: falseGives a smooth transfer to a newly opened tab from the current view into this Tab and make this Tab active. Only one Tab can have this parameter. Platforms:WM, Win32, Android, iOS

                   

                  Brian

                    • Re: Still no decent tabbar in rhomobile?
                      Jochem Pouwels

                      I just tried it, but the whole app gets stuck in splashscreen when I do that..

                      Xcode fails on an assert:

                      - (UIWebView*)detachWebView {

                          [self restoreWebView];

                          UIWebView *w = [webView retain];

                          [w removeFromSuperview];

                          webView.delegate = nil;

                          self.webView = nil;

                         

                          assert(w && [w retainCount] == 1); <-------- THIS ONE

                          return w;

                      }

                      I get this error in the log:

                      Assertion failed: (w && [w retainCount] == 1), function -[SimpleMainView detachWebView], file /Users/beheerder/.rvm/gems/ruby-1.9.3-p448/gems/rhodes-4.0.0/platform/iphone/Classes/SimpleMainView.m, line 696.

                       

                      Any help?

                      I am creating the tabs in the method that is configured as starting method in RhoConfig as follows:

                            Rho::NativeTabbar.create([{

                            :label => "xxx",

                            :action => "/app/xxx/",

                            :useCurrentViewForTab => true,

                            :icon => "/public/images/tabs/xxx.png",

                            :selectedColor => 0x000000,

                            :backgroundColor => 0xb5bdc8

                            }...............

                • Re: Still no decent tabbar in rhomobile?
                  Jon Tara

                  I think it's silly that the tabbar and multiple UIWebViews are tied-together in one component. One really has nothing to do with the other.

                   

                  Sometimes you want a native tab bar, but you don't need multiple UIWebViews.

                   

                  Sometimes you want multiple UIWebViews, but you don't need a native tab bar.

                   

                  I have quite a few use cases for this, and probably will just write my own native view extension to create extra UIWebViews. Of course, this requires per-platform native code, and it's likely I'll only support OSX. Would be better if Motorola were to supply this.

                   

                  A "would be nice" feature would be transitions between the UIWebViews similar to jQuery Mobile.

                    • Re: Still no decent tabbar in rhomobile?
                      Jochem Pouwels

                      I think in my situation I do need to have the tabbar and multiple UIWebViews tied-together..

                      All i am trying now is to have a smooth app start, splashscreen.... and then bamm the homescreen with tabbar without any blank screen..

                       

                      Did you make any app with the tabbar and got it working correctly?

                       

                      Also I read somewhere that you managed to preload the tabs in iOS by doing a webview.navigate(...., x) in the tabbar callback on start..

                      But that did not work completely because with an tabswitch the page still reloads, wouldnt it be an idea to find the part of objective c that reloads the tabs on iOS and disable the reload?

                       

                      I really would like to make my app more native like... The tabbar just make whole my app so bad because all those blank screens.

                       

                      Any help would be appreciated!

                      Thx

                      • Re: Still no decent tabbar in rhomobile?
                        Jochem Pouwels

                        Hey Jon, got any updates on your progress in making your own changes to the native code of the tabbar?