0

I've got a HorizonalPager and following code ...

 HorizontalPager(
        pageCount = itemList.size,
        state = PagerState(),
        key = { itemList[it] }
    )
    { index ->
        Image(painter = painterResource(id = itemList[index]), contentDescription = null,
            contentScale = ContentScale.Crop,
            modifier = Modifier.fillMaxSize()
        )

    }
}
}

ItemList contains ressourceID of two svg. Images which I have converted in Android Studio to xml in ressource folder -

get RessourceID

 val resourceIDa = mContext.resources.getIdentifier(picName, "drawable", mContext.packageName)
   

Activity appears but no picture

any help?

VFarkas2023
  • 295
  • 1
  • 1
  • 8
  • You compose code looks fine. Did you try referencing the same drawable using the `R.drawable.drawableName` syntax? Does that work? Did you check the id you get when calling `getIdentifier`? Is it valid (`> 0`)? – Jan Bína May 22 '23 at 16:04

0 Answers0