Advertisement
Guest User

code

a guest
Mar 30th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Index.xml
  2.  
  3. <TableViewRow  height="Ti.UI.SIZE" id="row_audio">
  4.     <View layout='vertical' id="audio_section" dataCollection="VideoG" height="Ti.UI.SIZE" top='10'>
  5.             <Require src="Galerias/Componentes/Audio"></Require>
  6.     </View>
  7. </TableViewRow>  
  8.  
  9. // Index.js
  10. var model = Alloy.createModel('VideoG',{});
  11. Alloy.Collections.VideoG.add(model);
  12.  
  13. Alloy.Collections.VideoG.on("add remove", function(e){
  14.     if(OS_IOS) $.row_audio.height = (Alloy.Collections.VideoG.length * 280) + "dp";
  15.     if(OS_ANDROID) $.row_audio.height = (Alloy.Collections.VideoG.length * 240) + "dp";
  16.     $.audio_section.height = (Alloy.Collections.VideoG.length != 0) ? Ti.UI.FILL:  0;
  17.     (Alloy.Collections.VideoG.length != 0) ? $.audio_section.show(): $.audio_section.hide();
  18. });
  19.  
  20. //Audio.xml
  21. <Alloy>
  22.     <Collection src='Galeria'></Collection>
  23.     <Collection src="VideoG"/>
  24.     <View id="row_audio">
  25.         <TextField id="autor" value="{autor}" hintText="Autor" onChange="actualizaAutor"></TextField>
  26.     </View>
  27. </Alloy>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement