我想設置視圖以下屬性:無法找到屬性的android二傳手:layout_toRightOf
android:layout_toRightOf="@{}"
數據綁定。我明白android會轉換camelCase中每個視圖的id。當我做
<RelativeLayout>
<TextView
android:layout_toRightOf="@{layoutFlag ? myButton : myImageButton }"
/>
<Button
android:id="@+id/my_button"/>
<ImageButton
android:id="@+id/my_image_button"/>
</RelativeLayout>
,但我得到了以下錯誤:
Error:(79, 45) Cannot find the setter for attribute 'android:layout_toRightOf' with parameter type android.view.View on android.widget.TextView.
不起作用 – Thalatta