i don’ tr want use ConsrtrainsLayout but i have to...
# compose
a
i don’ tr want use ConsrtrainsLayout but i have to develop a splashscreen with big log to cenrter and a little text (copyright) to bottom. what layout can use Box or two Box? I used two Box
Copy code
Box(modifier = Modifier
    .fillMaxSize()
    .background(BlueDentPad), contentAlignment = Alignment.Center) {
    Image(
        painter = painterResource(id = R.drawable.logo), contentDescription = null,
        contentScale = ContentScale.FillWidth,
        modifier = Modifier
            .padding(10.dp)
    )
    
}

Box(modifier = Modifier
    .fillMaxSize().padding(10.dp), contentAlignment = Alignment.BottomCenter) {
    Text(text = "Company © 2022", color = Color.White, textAlign = TextAlign.Center)

}
r
You can use a single box with .fillMaxSize() and then place elements inside with .align modifier. This will help you to not worry even for small screen devices @Android75
a
Copy code
Box(modifier = Modifier
    .fillMaxSize()
    .background(BlueDentPad) ) {
    Image(
        painter = painterResource(id = R.drawable.logo), contentDescription = null,
        contentScale = ContentScale.FillWidth,
        modifier = Modifier
            .padding(10.dp), alignment = Alignment.Center
    )

}
Logo is top left not center
ah Modifir.align
it works, thanks
🙌 1
r
@Android75 Let me know if you work it out. Or else, Ill provide you a snippet
a
@Ritwik Raj Srivastava it works.. my error is not use Modifier.align but alignment