Closed SergeiZavialov closed 3 years ago
Does the custom view correctly work in runtime?
What version of Android Studio did you use ?
At runtime custom view works correctly. Trouble only with preview. I use
Android Studio 4.1.2 Build #AI-201.8743.12.41.7042882, built on December 20, 2020 Runtime version: 1.8.0_242-release-1644-b3-6915495 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.16
I don't know what to do. The bug is minor. Will not be fixed. Close it for now
Have the same issue. How do you think, using delegate is necessary in custom views at all? I just do this and preview works perfectly
class MyView@JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : MaterialCardView(context, attrs, defStyleAttr) {
private val binding = MyViewBinding.inflate(LayoutInflater.from(context), this)
}
Check 1.4.6. The issue must be fixed
Hi. I have a trouble with my custom view where i use viewBinding delegate.
library version: implementation 'com.kirich1409.viewbindingpropertydelegate:viewbindingpropertydelegate:1.4.1'
My view code
XML for custom view:
And when i add my view to layout - i have an "Failed to instantiate one of more classes"
What do i wrong?