android - 如何将参数传递给kotlin中videoview xml的setvideopath方法
问题描述
我有一个简单的问题,是否可以从 kotlin 中的 xml 文件调用 setvideoPath 方法
这是我的视频视图标签
<VideoView
android:id="@+id/url"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
我应该添加什么来将参数传递给 setVideoPath 方法
注意我不想使用
findViewById
方法,因为我使用的是 MVVM 模式
解决方案
推荐阅读
- performance - TTFB(Time-To-First-Byte)计算由什么组成,以及如何查看各个组件的时序?
- vue.js - 如何将 Vue Webpack-simple 应用程序部署到 Netlify?
- c++ - 重写虚函数和继承
- neo4j - Neo4j:将不同节点链接到一个节点
- arrays - Angular2:如果项目包含在其他其他数组中,则过滤数组
- c# - WPF绑定列表到数据网格可编辑组合框列
- mysql - Sequelize 连接到故障转移写入副本
- linux - 尝试编辑 crontab 时光标不会向右移动
- kubernetes - 将 MFA 与 EKS kubectl 和 aws-iam-authenticator 一起使用
- c - 用于 Windows 32 控制台应用程序的 C 中的计时器事件