Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

256
Views
Jetpack Compose vector de imagen desplazada en Canvas

Tengo un problema con la imagen vectorial en Canvas . Como se muestra a continuación, solo puedo llamar a la imagen vectorial pero no puedo hacer ningún desplazamiento en Canvas . Así que solo puedo tenerlo como está.

No sé la razón por la que no hay una opción de Offset como en drawCircle o drawRect , si alguien tiene algunas ideas, sería genial.

 val vector = ImageVector.vectorResource(id = R.drawable.ic_test) val painter = rememberVectorPainter(image = vector) Box(contentAlignment = Alignment.Center) { Canvas( modifier = Modifier .fillMaxWidth() .padding(10.dp) ) { with(painter) { draw( painter.intrinsicSize ) } } }

Intenté algo como agregar Offset en with(painter) pero nada cambia:

 with(painter) { draw( painter.intrinsicSize ) Offset(x = 10f, y = 10f) }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puedes usar DrawScope.translate :

 translate(left = 10f, top = 10f) { with(painter) { draw( painter.intrinsicSize ) } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!