Questions tagged «android-viewbinding»


5
java.lang.NullPointerException:缺少ID为的必需视图:
Android Studio 3.6 在app / build.gradle中: android { viewBinding.enabled = true 这是我的xml: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/bluetoothBottonMainContainer" android:layout_width="0dp" android:layout_height="104dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> <View android:id="@+id/viewPointNotSelect" android:layout_width="16dp" android:layout_height="16dp" android:background="@drawable/circle_transparent" app:layout_constraintBottom_toBottomOf="@+id/separator" app:layout_constraintEnd_toStartOf="@+id/separator" app:layout_constraintTop_toTopOf="parent" /> 和另一个xml,这是不言而喻的。xml: <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/bottonContainer" android:layout_width="0dp" android:layout_height="104dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent"> <include android:id="@+id/qrBottonContainer" layout="@layout/qr_bottom_container" android:layout_width="0dp" android:layout_height="wrap_content" …

3
ViewBinding-如何获取包含布局的绑定?
在使用ViewBinding时,我遇到了一些未记录的案例。 第一:如何获取包含的通用视图布局零件的绑定,主绑定仅查看主布局中的项目? 第二:如何获取包含的合并类型布局零件的绑定,再次主绑定仅查看主布局中的项目?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.