Comments (11)
I too have the crashing problem.
I'm just not sure if it's only with NappDrawer it happens, but it does happen.
Apparantly according to the following it has to do with the Holo theme.
A Q&A here discusses it in more detail: http://developer.appcelerator.com/question/151567/google-maps-v2-module-crashes-when-view-placed-in-tab-group
And a bugticket on JIRA here: https://jira.appcelerator.org/browse/TIMODOPEN-230
Another JIRA: https://jira.appcelerator.org/browse/TIMOB-13864
The tickets appear to be largely ignored by Appcelerator though, so it would be nice if we could find a solution for this!
My temporary workaround has been to create a new view and add the map to that. Then I replace the existing centerView with this new one. This seems the prevent the crash.
from nappdrawer.
Here's my simple code:
var NappDrawerModule = require('dk.napp.drawer');
var MapModule = require('ti.map');
var leftMenuView = Ti.UI.createView({
backgroundColor:'red',
});
var centerView = Ti.UI.createView({
backgroundColor:'blue',
});
var mapView = MapModule.createView({
userLocation: true,
mapType: MapModule.NORMAL_TYPE,
animate: true,
region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
height:'100%',
width:'100%',
});
centerView.add(mapView);
var mainWindow = NappDrawerModule.createDrawer({
leftWindow:leftMenuView,
centerWindow:centerView,
leftDrawerWidth: "260dp",
navBarHidden:true,
});
mainWindow.open();
bitfabrikken, is your workaround something like this? It's still crashing... all the time. I have no problem with the map alone...
from nappdrawer.
Added a bit to your example code, which makes it work.. But it's weird.
var NappDrawerModule = require('dk.napp.drawer');
var MapModule = require('ti.map');
var leftMenuView = Ti.UI.createView({
backgroundColor:'red',
});
var centerView = Ti.UI.createView({
backgroundColor:'blue',
});
var mapView = MapModule.createView({
userLocation: true,
mapType: MapModule.NORMAL_TYPE,
animate: true,
region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
height:'100%',
width:'100%',
});
//centerView.add(mapView); //don't add mapView yet!
var mainWindow = NappDrawerModule.createDrawer({
leftWindow:leftMenuView,
centerWindow:centerView,
leftDrawerWidth: "260dp",
navBarHidden:true,
});
mainWindow.open();
//for some reason, this works..
mainWindow.addEventListener('open',function(){
var new_view = Ti.UI.createView({
backgroundColor:'purple',
});
mainWindow.setCenterWindow(new_view);
setTimeout(function(){
new_view.add(mapView);
},1000);
});
from nappdrawer.
Hey it works!! Thanks a lot for the workaround, bitfabrikken! Yes it is a bit weird, but it'll do for now until a better solution comes out. Thanks again.
from nappdrawer.
Update: Unfortunately, this doesn't work on newer android devices. I tried on Samsung Galaxy W, Android 2.3... it works just fine, but when tried on S3 and Note 3, it crashes everytime...
from nappdrawer.
The fix works for me on Nexus 4, Nexus 5 and Nexus 7 (the first model).
from nappdrawer.
@viezel - do you have any ideas on this issue? Maybe it's not your module, but the module it's built on? Or maybe a general Titanium thing?
from nappdrawer.
im almost sure it has nothing to do with my module. I know their are certain bugs in jira regarding the new map module.
If you look at the source code for NappDrawer you will find that I open 3 views and do some custom animations to make them slide in and out. Thats about it. nothing super fancy, that should break google maps.
from nappdrawer.
Viezel,
I know you closed this issue, but regardless of what solution I use posted, I cannot get a map drawn in the centerView without crashing the app. I can put it on a setInterval delay of 5000ms and still, once the add method is called - crash.
This is a bit of the XML I used in the alloy to set the main view area:
from nappdrawer.
this is still happening, did anyone find a workaround?
from nappdrawer.
I have this problem for a long time and finally @bitfabrikken solution works for me. Important thing is, that you have to add mapView after drawer opens.
from nappdrawer.
Related Issues (20)
- Setting the title and nav buttons on the status bar (iOS)
- (Android) NappDrawer not showing when resuming to app via intent HOT 1
- App crashes when setRightWindow only HOT 5
- Not working with SDK 6.3.0 HOT 5
- How to reopen drawer which is closed by drawer.close()
- Latest Titanium SDK not support HOT 6
- iOS — Open Drawer Animation Bug (v2.0.0) 🐛 HOT 6
- App crashes after setting centerWindow multiple times (iOS) HOT 18
- Child windows orientations HOT 8
- Build errors when trying to compile with 7.0.2.GA HOT 1
- RefreshControl in listview is lost after switching between winodws.
- iOS - setLeftWindow(false) throws error using Titanium 7.1.0 GA HOT 1
- [Android] Drop-down list not shown in Webview HOT 2
- 8.0.1.GA Support HOT 5
- [Android] addWindowToStack error using v2.0.2 in TiSDK 8 HOT 2
- iOS module is not working with latest SDK 8.2.0.GA. HOT 1
- iOS module not working on iOS 13 VoiceOver
- 2.1.1 version of navdrawer cause app crashing HOT 1
- drawer.setAnimationMode not working on sdk 10 HOT 1
- Crash on iOS 12.5.4 and Ti SDK 10.0.0.GA HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nappdrawer.