Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

128
Visualizações
toggle a switch to off when interacting with another In a nativescript

I'm trying when I interact with a switch the others go to false can anyone help? XML code:

                <StackLayout dock="top" height="90%" width="100%" style="">
                <StackLayout tap="{{ definicoesTap }}" >
                    <Label text="    Voltar" paddingLeft="15%" class="drawerItemText font-awesome" />
                </StackLayout>
                <StackLayout class="hr-light"></StackLayout>
                <StackLayout orientation="horizontal" marginTop="20" marginLeft="20">
                    <Switch id="notOFF" checkedChange="{{ teste }}" checked="False"/>
                    <Label text="Desativar todas as notificações" style="color:#000;font-size:17" marginLeft="5" />
                </StackLayout>
                <StackLayout orientation="horizontal" marginTop="20" marginLeft="20">
                    <Switch id="notON" checkedChange="{{ teste }}" checked="False"/>
                    <Label text="Ativar todas as notificações" style="color:#000;font-size:17" marginLeft="5" />
                </StackLayout>
                <StackLayout orientation="horizontal" marginTop="20" marginLeft="20">
                    <Switch id="notSMS" checkedChange="{{ teste }}" checked="False"/>
                    <Label text="Ativar apenas mensagens" style="color:#000;font-size:17" marginLeft="5" />
                </StackLayout>
                <StackLayout marginTop="20">
                    <Button text="Confirmar" tap="{{ definicoesTap }}" class="btn btn-secundary m-t-20" />
                </StackLayout>
            </StackLayout>

I created a function that executes when I activate the switches, now i want when 1 is true the others would be false JavaScript Code:

viewModel.teste = (args) => {
var objeto = args.object;
if (objeto.checked == true) {

    switch (objeto.id) {
        case "notOFF":
            console.log("Todas as notificações desligadas")
            break

        case "notON":
            console.log("Todas as notificações ligadas")
            break

        case "notSMS":
            console.log("Apenas as notificações das mensagens")
            break
    }
}

}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda