Can I delete labels?

You must Login before you can answer or comment on any questions.

Hey ;) How can I delete old labels? I request the text for the label from from a text file on my server. Every time when a tab is active, the text file refreshes... But now I have hundreds of dublicates from this label?

So I want to delete the label and after refresh show it again?! Is there any solution?

— asked 11 months ago by Alex Bohs
0 Comments

3 Answers

Hi,

You can use remove() function to remove lables from view or window, yoy can also refresh the lable by changing text property value.

Lable.text ='new value';

Or

parent.remove(); //parent can be either window or view ,on which lable are added.

Everytime when you click on the tab, this function will be loaded.

....
 
window.addEventListener('focus', function(e) {
 
window.remove(window.scrollbar); // delete scrollview named "scrollbar"
 
myDoRefreshFunction("https://mydomain.com/api/getnew.php",window); // This creates a scrollview with content to var = scrollbar and adds this scrollview directly to "window"
 
});
How can I now delete the old ScrollView and replace it with the new? It doesn't works with --> window.remove(window.scrollbar); ???

I do it now like this. But now I have another big problem. My ScrollView does not scroll anymore??!

window.addEventListener('focus', function(e) {
    myDoRefreshFunction("https://meinemeinung.me/API/iOS/requestlast.php",liveFenster);
});
 
window.addEventListener('blur', function(e) {
    if (window && window.children != undefined)
    {   
        // Save childrens       
        var removeData = [];
        for (i = window.children.length; i > 0; i--){
            removeData.push(window.children[i - 1]);  
        };
 
        // Remove childrens
        for (i = 0; i < removeData.length; i++){
            window.remove(removeData[i]);
        }
        removeData = null;
    };
});

— answered 11 months ago by Alex Bohs
answer permalink
1 Comment
  • Are u using scroll view property contentHeight:'auto'. If not then try.... Hope this solve.ur problem.

    — commented 11 months ago by Moiz Chhatriwala

Your Answer

Think you can help? Login to answer this question!