Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

LeftNavButton change dynamic button background image

$
0
0

I try to change the background image of a LeftNavButton after a click, but nothing happens. When I do this with a normal button the image will change. Are there some restrictions in doing that or is there another way to do that?

index.xml:

<Alloy>
    <NavigationWindow id="win1" platform="ios">
        <Window id="win2" title="Window">
            <LeftNavButton>
                <Button id="navButtonFilter" class="navButtonFilter" onClick="doClick" platform="ios" autoStyle="true">XX</Button>
            </LeftNavButton>
 
            <Button id="button" class="navButtonFilter" onClick="doClick"> </Button>
        </Window>
    </NavigationWindow>
</Alloy>

index.js:

function doClick(event) {
    Ti.API.info('doClick');
    $.addClass($.navButtonFilter, 'navButtonFilterActive');
    $.addClass($.button, 'navButtonFilterActive');
}
 
$.win1.open();
index.tss:
"#win1": {
    backgroundColor:"white"
}
 
".navButtonFilter": {
    backgroundImage : "/filter.png",
}
 
".navButtonFilterActive": {
    backgroundImage : "/list.png",
}

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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