mercredi 29 octobre 2014

How to enable button focus on touchStart?


Vote count:

0




I have created a button, I need some response from button like, on touch of the button, the button focus should enable like change in background color. How can I do that?


My code is, View:



<Button class="button" id="proceedButton" onClick="openQuestionnaire">Proceed</Button>


Style:



".button":{
width: '50%',
top: '25dp',
borderRadius: 8,
borderWidth: 1,
borderColor: '#808080',
backgroundGradient: {
type: "linear",
startPoint: { x: "0%", y:"0%"},
endPoint: { x: "0%", y:"100%"},
colors: [
{ color: "#4F94CD", offset: 0.0 },
{ color: "#4F94CD", offset: 1.0 }
]
}
}


Controller:



$.proceedButton.addEventListener('touchstart', function() {
$.proceedButton.isFocused = true;
});

$.proceedButton.addEventListener('touchend', function() {
$.proceedButton.isFocused = false;
});


The above code is not working. Just I need to slight chage in background color while touch of the button.


Any solution!!



asked 50 secs ago







How to enable button focus on touchStart?

Aucun commentaire:

Enregistrer un commentaire