-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crashes if I switch from win to navController in centerView #2
Comments
This also happens when I try to switch from a |
also when switching from a TabGroup to a Window or from a TabGroup to a NavigationWindow, always crashing when toggling the center window from one window to the other. sometimes it will get by 1-3 switches and then crash. using Alloy 1.2.2/iOS7/Ti SDK 3.1.3.GA index.js Alloy.Globals.win_blue = Alloy.createController('bluewin').getView();
Alloy.Globals.win_green = Alloy.createController('greenwin').getView();
var NappDrawerModule = require('dk.napp.drawer');
var drawer = NappDrawerModule.createDrawer({
leftWindow: Alloy.createController('sidemenu').getView(),
centerWindow: Alloy.Globals.win_green,
closeDrawerGestureMode: NappDrawerModule.CLOSE_MODE_ALL,
openDrawerGestureMode: NappDrawerModule.OPEN_MODE_ALL,
leftDrawerWidth: 200
});
Alloy.Globals.drawer = drawer;
drawer.open();
drawer.setAnimationMode(NappDrawerModule.ANIMATION_PARALLAX_FACTOR_3); sidemenu.xml <Alloy>
<Window id="sidemenu" title="Side Menu" backgroundColor="white">
<Button id="green" color="green" onClick="doClick_green">Green</Button>
<Button id="blue" color="blue" onClick="doClick_blue">Blue</Button>
</Window>
</Alloy> sidemenu.js function doClick_blue(e) {
Alloy.Globals.win_blue.open(); // this works
Alloy.Globals.drawer.centerWindow = Alloy.Globals.win_blue; // this crashes
} greenwin.xml <Alloy>
<Window id="green_win" title="Green Window" backgroundColor="green">
<Button color="black" style="bottom:30" onClick="closeWindow">Close Window</Button>
</Window>
</Alloy> bluewin.xml <Alloy>
<Window id="blue_win" title="Blue Window" backgroundColor="white">
<Button color="black" style="bottom:30" >Blue</Button>
<Button id="green" color="#1B65FF" style="bottom:100" >Green</Button>
</Window>
</Alloy> |
try this and let me know: https://github.com/viezel/NappDrawer/releases/tag/1.1.0 |
still crashes when switching from a NavigationGroup to a Window |
Try with navigation window |
sorry, I meant NavigationWindow |
works fine here.. |
@viezel works fine for you using my testcase? because it's also crashing for me. |
im not using your testcase.. sorry, open source != support :) |
I can confirm that it still crashes, with the Alloy testcase I detailed above.
|
I was also experiencing this issue. You need to make sure you only use NavigationGroups with versions 1.0.3 and below, while 1.1 will only work with NavigationWindows. Corresponding diff: |
@mrlundis I am using 1.1 with an Alloy project (see source on the top of this thread), NavigationWindow only and it crashes when I set the center view more than once. |
@moshemarciano As far as I can tell from the source only regular Windows and NavigationWindows are supported as of now. TabGroups and other window types might need additional logic to access the proper native controllers. |
@mrlundis I am using a navigationWindow, still crashing '''XML
''' |
@moshemarciano Okay, my bad. Try opening the generated Xcode project and run the application from there, that way you can get a proper stack trace and might be able to figure out whats causing the crash. If you also open up the NappDrawer module project you'll be able to step through the full source from within your own application which is very useful for debugging. Other than that I can't be of much further help. Good luck! |
This doesn't happen to me when using NavigationWindow instead of NavigationGroup. Tested in simulator with 3.1.3.GA |
@janhelleman can you share the test code? maybe I am doing something wrong. is it also Alloy based? |
Let's see. index.js:
center.xml
centertwo (opened on clicke)
center three (opened on clicke centertwo, has isBase true)
in the clicke functions:
I think this is most of it. As you can see it uses navigationwindows instead of groups. It switches (depending on what platform it caches the previous views) in index.js at Alloy.Globals.openWindow(). Is this enough to go on? Kind regards, |
Also, if from NavigationWindow to NavigationWindow might work, but NavigationWindow to Window (or visa versa) doesn't work, you might consider using a NavigationWindow for the Window without the navbar. |
For Alloy - the solve seems to be setting drawer views as < Window > and the center or main view as: < NavigationWindow platform="ios" id="" > < Window id="loginModal" > < /Window > < /NavigationWindow > Any views you load into the center/main view should be < NavigationWindow > and drawer views should just be < Window > //MD |
When I programmatically switch out a navController in centerView with a plain window it crashes on iOS 7 and Ti SDK 3.1.3.v20130910153050.
app.js
nav.js
win.js
The text was updated successfully, but these errors were encountered: