android - Titanium developing: I want to put a view always visible from the second view and beyond. I'm using a scrollView -
i'm developing app in titanium. i've divided in 4 different views make scrollview. want put view visible second view , beyond. how can that?
ther app.js code:
(function(e){ var principal = ti.ui.createwindow({ backgroundcolor: '#fbfbfb', exitonclose:true, navbarhidden: true }), pantallabienvenida = require('ui/pantallabienvenida'), pantallatitular = require('ui/pantallatitular'), pantalladependiente = require('ui/pantalladependiente'), pantallaasistenciamedica = require('ui/pantallaasistenciamedica'), primerapantalla = new pantallabienvenida, segundapantalla = new pantallatitular, tercerapantalla = new pantalladependiente, cuartapantalla = new pantallaasistenciamedica, scrollview = ti.ui.createscrollableview({ views:[primerapantalla,segundapantalla,tercerapantalla,cuartapantalla] }); principal.add(scrollview); principal.open(); })();
you using scrollableview not scrollview, different.
if want show additional info when user goes second element of scrollableview have add new element window, set it's property visible = false.
then create event listener , when dragend fired make view visible.
some example code:
floatingview = require('ui/floatingview') floatingview.visible = false; principal.add(floatingview); scrollview.addeventlistener('dragend', function(event){ if (this.currentpage !== 0) { floatingview.visible = true; } else { floatingview.visible = false; } });
Comments
Post a Comment