Sean Proctor
04/12/2023, 6:08 PMAndroidView
or Modifier.weight()
change behavior in Compose 1.4? I have an AndroidView
in a Column
that I want to fill the remaining space. With Compose 1.3 this does what I want. With Compose 1.4, the PreviewView
fills the entire screen.
Column {
AndroidView(
modifier = Modifier.weight(1f),
factory = { context ->
PreviewView(context).apply {
layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
implementationMode = PreviewView.ImplementationMode.COMPATIBLE
}
}
)
SomeOtherContent()
}
Column {
Box(Modifier.weight(1f)) {
AndroidView(
factory = { context ->
PreviewView(context).apply {
layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
implementationMode = PreviewView.ImplementationMode.COMPATIBLE
}
}
)
}
SomeOtherContent()
}
shikasd
04/12/2023, 6:43 PM