如何在Jetpack compose中使用xml文件字段

问题描述 投票:0回答:1

我有旧的 xml。现在我想将其迁移到 Jetpack Compose。 我迁移了所有字段,但我在 mu xml 文件中有一个自定义字段:

com.activity.compose.MyRichEditor
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:inputType="textCapCharacters|textLongMessage|textAutoCorrect"
                android:id="@+id/message_view"
                android:visibility="gone"
                tools:ignore="WebViewLayout" />

它是RichTextEditor(可编辑的webview)的实现。

如何插入此类字段 MyRichEditor 来撰写视图?

xml webview android-jetpack-compose editor
1个回答
0
投票

您需要使用

AndroidView

AndroidView(
    modifier = Modifier,
    factory = { context ->
        MyRichEditor(context).apply {

        }
    },
    update = {

    },
)
© www.soinside.com 2019 - 2024. All rights reserved.