Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (ti.app)
Viewing all articles
Browse latest Browse all 15

Create Dynamic View and Keep in Memory

$
0
0

Hell there, i have a button creating a new view everytime i click on it. If i close my app, i open again the app, the views i created disapeared (so normal !!! ). How i can save in memory these new views?

var scrollable = Ti.UI.createScrollView({
        height: 400,
        top: 10,
        width: Ti.UI.FILL,
        layout: 'vertical'
    });
 
    var createCategory = Ti.UI.createButton({
        title:L('newCat'),
        top: 10
        height: 40
        width: 100
        color: "#fff",
            backgroundColor:'#3d93eb',
        borderRadius: 4,
        textAlign: 'center',
        font:{fontSize: 31}
    });
 
    win.add(scrollable);
    win.add(createCategory);
 
    createCategory.addEventListener('click',function(){
 
        var newCategory = Ti.UI.createView({
            width: 200,
            height: 80,
            top: 5,
            backgroundColor:'#f4f4f4',
            textAlign:'center',
            color: '#323131'
        });
 
        scrollable.add(newCategory);
 
    });

Viewing all articles
Browse latest Browse all 15

Trending Articles



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