I would like to set the height and width of an video view to match_parent
. My code looks something like the following. It works without the height
and width
attributes, but doing it as below give me a val cannot be reassigned
error.
class VideoActivityUI : AnkoComponent<VideoActivity> {
companion object {
val ID_VIDEO = 11
}
override fun createView(ui: AnkoContext<VideoActivity>) = with(ui) {
videoView{
id = ID_VIDEO
height = matchParent
width = matchParent
}
}
}