【发布时间】:2021-11-09 09:20:56
【问题描述】:
我在com.example.Example.kt中有一个简单的可组合函数:
@Preview
@Composable fun ExampleComposable() {
Text("Hello")
}
我尝试使用 ComposeViewAdapter,如下所示:
<androidx.compose.ui.tooling.ComposeViewAdapter
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:composableName="com.example.ExampleKt" />
Android Studio 不会在设计窗格中显示任何可组合项的预览。
另外,ComposeViewAdapter 与 androidx.compose.ui.platform.ComposeView 有何不同?
【问题讨论】:
标签: android android-xml android-jetpack-compose android-jetpack