pet*_*vid 5 android kotlin flutter
如何从 flutter PlatformView(Android kotlin 端)返回我的原生 android 活动, 这是我的 platformView 类:
class FlutterView internal constructor(context: Context?)
: PlatformView {
@Override
override fun getView(): View {
return // here i need to return my activity view
}
@Override
override fun dispose() {
}
}
Run Code Online (Sandbox Code Playgroud)
小智 0
您可以使用XML 布局LayoutInflater创建对象并将其返回到此处。View您可以从这里的信息中找到。从上面的文档中获取您首选方法的实例后LayoutInflater,您可以编写如下内容:
return inflater.inflate(R.layout.my_activity_layout, null)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
262 次 |
| 最近记录: |