Note that there are some explanatory texts on larger screens.

plurals
  1. POTitanium - Android - Using scroll view
    primarykey
    data
    text
    <p>I'm trying to prepare mobile app that runs on Android and iOS using Titanium Appcelerator <br> In one of the view, i'll send a request to server, get response and after parsing it, i'll create a scroll view with internal views and populate the data accordingly. The app is working fine on iPhone. But in Android, its not working peoperly. Unless and until i add the controls to windows, they are not being shown in Android.<br> I'd like to know if I've to set any thing to work properly in android.<br> The following code is used to add the subviews to scroll view:</p> <pre><code>var xPos = 0; for (var i = 0; i &lt; cityCodes.length; i++) { xPos = i*320; var cityImg = require('screens/views').cityDataView(xPos, cityClicked, cityCodes.item(i).text, cityNames.item(i).text, cityExportQuantities.item(i).text, exportPercentages.item(i).text, populationCount.item(i).text, popultionPercentages.item(i).text, rates.item(i).text ); scrlView.add(cityImg); } </code></pre> <p>I'm creating the scroll view as following:</p> <pre><code>scrlView = Titanium.UI.createScrollView({ contentWidth:'auto', contentHeight:'auto', top:'40%', height:'155dp', showVerticalScrollIndicator:true, showHorizontalScrollIndicator:false }); </code></pre> <p>I'm creating the city data view as following:</p> <pre><code>cityDataView: function(xPos, showCityDetails, cityCode, cityName, exportQuantity, exportPercent, popCount, popPercent, rate) { var tempLabel = function(topPos,txt){ // Ti.API.log(topPos); var custLabel = Ti.UI.createLabel({ color:'#000', text:txt, right:'55%', top:topPos, font:{ fontSize:14, fontFamily:'GE SS Text Light' }, textAlign:Titanium.UI.TEXT_ALIGNMENT_RIGHT, width:'auto' }); return custLabel; }; var cityImg = Ti.UI.createImageView({ left:xPos, height : '155dp', width : '100%', image : '/images/citydetails.png' }); cityImg.addEventListener('singletap', function(){ Ti.API.log(cityCode); showCityDetails(cityCode); }); var cityNameLbl = Ti.UI.createLabel({ color:'#ffffff', text:cityName, height:'15dp', top:'6%', font:{ fontSize:14, fontFamily:'GE SS Text Light' }, textAlign:Titanium.UI.TEXT_ALIGNMENT_RIGHT, width:'auto' }); cityImg.add(cityNameLbl); var exportQtyLbl = tempLabel('19%',exportQuantity); cityImg.add(exportQtyLbl); var overallProd = tempLabel('35%',exportPercent); cityImg.add(overallProd); var populationCount = tempLabel('53%',popCount); cityImg.add(populationCount); var populationPercent = tempLabel('69%',popPercent); cityImg.add(populationPercent); var rateText = tempLabel('85%',rate); cityImg.add(rateText); // var totalExportText = tempLabel('95%',totalExport); // cityImg.add(totalExportText); return cityImg; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload