Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17485] Replacing UINavigationController in custom module results in flickering

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2014-08-12T17:34:39.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
LabelsTCSupportTriage, module, nappdrawer
ReporterMarcel Pociot
AssigneePedro Enrique
Created2014-07-29T08:07:16.000+0000
Updated2017-03-31T22:24:00.000+0000

Description

When using the (very popular) native module "NappDrawer" the window flickers for a few milliseconds upon replacing the center ViewController with a UINavigationController. The problem only appears in landscape mode. "NappDrawer" uses the native library "MMDrawerController" which doesn't have this issue. There's also a Github issue with more information on this issue: https://github.com/viezel/NappDrawer/issues/7 To reproduce the issue download and install the latest version of the NappDrawer module and create a new app with the given app.js. If you repeatedly click on "Flickers in landscape" you will see the effect. https://github.com/viezel/NappDrawer/tree/master/ios/dist I managed to take a screenshot of the iOS 6 version - which also has this bug. You can see that the window/buttons are not yet positioned correctly which is why the screen flickers.

Attachments

FileDateSize
app.js2014-07-29T08:07:16.000+00001275
flickering.gif2014-07-29T08:07:16.000+0000117985
navigation_layout.png2014-07-29T21:31:22.000+000017088

Comments

  1. Pedro Enrique 2014-08-12

    I have been doing some testing and research. The main problem here is performance with Titanium. When the window is replaced and displayed, a number of internal UIViewController methods are called on the window, and this is where in Titanium we need to process the properties of the window, sub views, etc. After testing and debugging I found a work around, which is a small change in the MMDrawer source code, basically add a delay when a UIViewController removed as it is being replaced. (Let me know if you'd like to implement it) The good news is that this is actually working much better in SDK 3.3.0.GA, as Harish mentioned. There has been some performance improvements in Titanium from 3.2.0 to 3.3.0 and these have fixed the issue. The latest tests I have done have been with Ti SDK 3.3.0.GA and I have not seen the flickering anymore. PS: To see the window, please use a different background color, "black" doesn't really do it. Marking ticket as fixed.
  2. Manojkumar Murugesan 2015-09-25

    Hi [~penrique], Can you please help me on adding a delay when a UIViewController removed to avoid the flickering? Thanks!
  3. Pedro Enrique 2015-09-28

    [~mano_mykingdom], if you're using the latest Titanium SDK, 5.x.x, try adding this to your tiapp.xml, in the ios section:
       <ios>
       	<run-on-main-thread>true</run-on-main-thread>
       	// more stuff here
        </ios>
       
  4. Manojkumar Murugesan 2015-09-28

    Thank you for your help [~penrique], but I'm using 4.1.0.GA only but still it is flickering while replacing the nav window, easily noticeable at nav bar only. Do you have any other suggestions or will that delay work?
  5. Lee Morris 2017-03-31

    Closing ticket as fixed, if there are any problems, please file a new ticket.

JSON Source