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

303
Visualizações
Jetpack Compose imageVector : how do I able to use the Social vector from google fonts

I tried to import the icon provided by Google Font according to the prompts of Google Font, but I found that I could not import the icon of cake into my EditText. Can you please take a look what is going on ?Thank you so much !

@Composable
fun ShowTextField(context:Context){
  
    var text by remember {
        mutableStateOf("")
    }
    TextField(value = text ,
        onValueChange = {text = it},text
        label = { Text(text = "birthday")},
        leadingIcon = @Composable{
            
            Image(
                imageVector = Icons.Filled.Cake,
                contentDescription = "cake",
                modifier = Modifier.clickable { 
                    Toast.makeText(
                        context,
                        "Your Birthday:${text}",
                        Toast.LENGTH_SHORT
                    ).show()
                }
            )
        }
    )
}

Cake Google Font

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

  1. I think you need to download it as .svg file and import into drawable as vector asset before you use it,
  2. if you already imported it, you should use Icon(), not Image() and instead of imageVector just use "painterResource(R.drawable.cake)," (of course if you named your asset as "cake"
@Composable
fun ShowTextField(context:MainActivity){

    var text by remember {
        mutableStateOf("")
    }
    TextField(value = text,
        onValueChange = {text = it},
        label = { Text(text = "birthday")},
        leadingIcon = @Composable{

            Icon(
                painterResource(R.drawable.cake),
                contentDescription = "cake",
                modifier = Modifier.clickable {
                    Toast.makeText(
                        context,
                        "Your Birthday:${text}",
                        Toast.LENGTH_SHORT
                    ).show()
                }
            )
        }
    )
}
over 4 years ago · Santiago Trujillo Relatório
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