1
嘗試使用百分比支持庫創建帶佈局的簡單圖形,但我無法弄清楚,如何通過數據綁定來指定百分比來查看。嘗試返回字符串「60%」,浮動0.6f,浮動0.6f,詮釋60.沒有任何作品。使用數據綁定將百分比分配給PercentFrameLayout
<View
android:id="@+id/graph_before"
android:layout_height="@dimen/list_graph_line_height"
android:layout_gravity="center_vertical"
android:background="@color/colorAccent"
app:layout_marginLeftPercent="@{item.percentValueLeft}"
app:layout_widthPercent="@{item.percentValueWidth}"
/>