Bradleycorn
01/15/2021, 6:35 PMBradleycorn
01/15/2021, 6:36 PM@Preview
that looks like this:
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colors.background
) {
Text("Hello Android!")
}
Bradleycorn
01/15/2021, 6:36 PMBradleycorn
01/15/2021, 6:39 PMModifier.fillMaxSize()
on the Surface composable in the @Preview.
But, the preview is clearly making some assumptions there about the dimensions of the screen/device that the composable will be displayed on. Are there any settings or anything in Android Studio to control those assumptions?Mark Murphy
01/15/2021, 6:50 PM@Preview
annotation accepts a bunch of properties, including widthDp
and heightDp
. This blog post is a bit old but should be still decent: https://commonsware.com/blog/2020/06/07/preview-annotation-properties.htmlBradleycorn
01/15/2021, 8:05 PM