Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Flip animations between views resets map annotations - iOS

$
0
0

I have a simple function to flip between a map view and a list view when the user clicks a button:

$.listBtn.addEventListener('click', flipViews);
$.listBtn2.addEventListener('click', flipViews);
var state = true;
function flipViews(e){
 
    var parent = $.viewFlip;
 
    if(state){
 
        parent.animate({
           view: $.list,
           transition: Ti.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT,
           duration: 400
        });
 
    } else{
 
        parent.animate({
           view: $.map,
           transition: Ti.UI.iPhone.AnimationStyle.FLIP_FROM_RIGHT,
           duration: 400
        });
 
    }
 
    state = !state;
 
}
here is the basic page structure:
<Window title="Discover"><View id="viewFlip">
    <View id="list">
        <Button id="listBtn" />
        <TableView />
    </View>
    <View id="map">
        <View ns="Alloy.Globals.Map" id="view_map" />
        <Button id="listBtn2" />
    </View>
</View></Window>
However, fliping to the list view and back to the map, completely resets the map (removes all annoations and resets zoom). It also resets a pop over I have within the view which has its opacity set to 0 well before the flip takes place.

The list view however, retains its state perfectly.

Is this a feature or a bug?

Im using SDK 3.4.2, iOS 8

Thank you for any help on this!


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>