Cố gắng thiết lập tầm nhìn của Viewsử dụng biến tùy chỉnh, nhưng lỗi xảy ra: Identifiers must have user defined types from the XML file. visible is missing it. Có thể đặt khả năng hiển thị dạng xem bằng cách sử dụng liên kết dữ liệu không? Cảm ơn.
<data>
<variable
name="sale"
type="java.lang.Boolean"/>
</data>
<FrameLayout android:visibility="@{sale ? visible : gone}"/>