[AC-2204] When using Ti.UI.Window.animate on a view inside a tab that contains a TableView, animating it to a view with a map and toggling back to the previous view causes all other views to not appear anymore.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-10-10T14:34:08.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | animation, ios, ios6, maps, mapview, tableView |
Reporter | Ygor Lemos |
Assignee | Mauro Parra-Miranda |
Created | 2012-10-09T21:17:36.000+0000 |
Updated | 2016-03-08T07:41:11.000+0000 |
Description
*Steps to reproduce*
Create an app with a TabGroup.
Add tabs.
In one of the tabs, add 2 view, one containing an Map and the other containing a TableView and other view (I've tested with a regular view and with a Toolbar).
Create code to animate between the 2 views using Window.animate() with either CURL_UP, CURL_DOWN, FLIP_FROM_LEFT or FLIP_FROM_RIGHT.
Create a button and the proper function to toggle between the 2 views on the container.
*Expected* The views should toggle inside the container (between the Navbar and the TabGroup) normally. *What happens* The views toggle normally with the effects, but when you return to the view containing the TableView, only the TableView is rendered, the other views disappear. *Environment* * Ti Mobile SDK 2.1.3.GA * iOS SDK 6 - XCode 4.5 Latest * Happens both on the Simulator and on iPhone 4S running iOS6 (haven't tested on other devices) *Test Case* It is coded using CommonJS so you need to require it on your app.js and add it to your tabbar directly (it returns a tab with the window): *bug.js:*
Window = function() {
var _title = "Test";
var w = Ti.UI.createWindow({
title: _title
});
var annotations = [];
var m = Ti.Map.createView({
maptype: Ti.Map.STANDARD_TYPE,
region: {latitude:-23.584038, longitude:-46.679044, latitudeDelta:0.05, longitudeDelta:0.05},
animate:true,
regionFit:true,
userLocation: true,
annotations: annotations
});
w.add(m);
var fbar = Ti.UI.createView({
top:0,
height: 42,
width: 320,
backgroundColor: "#333",
zIndex: 1
});
w.add(fbar);
var t = Ti.UI.createTableView({
data: [
{title: "Test 1"},
{title: "Test 2"},
{title: "Test 3"},
{title: "Test 4"},
{title: "Test 5"},
{title: "Test 6"},
{title: "Test 7"},
{title: "Test 8"},
{title: "Test 9"},
{title: "Test 10"},
{title: "Test 11"},
{title: "Test 12"},
{title: "Test 13"},
{title: "Test 14"},
{title: "Test 15"}
],
top: 42
});
w.add(t);
var state = "l";
var tbtn = Ti.UI.createButton({
image: "img/icons/map.png",
height: 40,
width: 40
}, function(){
if(state == "l") {
state="m";
w.animate({view:m, transition:Ti.UI.iPhone.AnimationStyle.CURL_UP});
tbtn.setImage("img/icons/list.png");
} else{
state="l";
w.animate({view:t, transition:Ti.UI.iPhone.AnimationStyle.CURL_DOWN});
tbtn.setImage("img/icons/map.png");
}
});
w.setLeftNavButton(tbtn);
return Ti.UI.createTab({
window: w,
icon: "img/icons/test.png",
title: _title
});
}
module.exports = Window;
How to add it to your app.js:
*app.js:*
Ti.UI.setBackgroundColor('#fff');
(function() {
var Test = {};
app = Ti.UI.createTabGroup({
barColor: "#0085c9"
});
Ti.UI.currentTabGroup = app;
Test.bug = require("bug")();
Test.bug2 = require("othertabwithwindow")();
Test.bug3 = require("othertabwithwindow2")();
app.addTab(Test.bug);
app.addTab(Test.bug2);
app.addTab(Test.bug3);
app.open();
})();
Tell me if you need anything else or if you need more explanations about the test case.
Please cancel this bug request... Just found out that I was dumb and transitioned just the TableView (and not the other views). Please delete it or flag as Dumb Reporter.
User reported this was actually a mistake in their code.
Invalid issue.