可拖动视图编号异常



下面是我的XML代码:

<com.github.pedrovgs.DraggableView 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:draggable_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/draggable_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
draggable_view:enable_minimized_horizontal_alpha_effect="true"
draggable_view:top_view_height="200dp"
draggable_view:top_view_id="@+id/image"
draggable_view:bottom_view_id="@+id/ll"
draggable_view:top_view_margin_bottom="50dp"
draggable_view:top_view_margin_right="10dp"
draggable_view:top_view_resize="true"
draggable_view:top_view_x_scale_factor="2.3"
draggable_view:top_view_y_scale_factor="2.3">
<ImageView
android:id="@+id/image"
android:background="@drawable/imgone"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.github.pedrovgs.DraggableView>

我应该在我的应用程序中具有拖动视图。在运行我的应用程序时,会抛出以下错误:

Caused by: android.view.InflateException: Binary XML file line #8: For input string: "200.0dip"
Caused by: java.lang.NumberFormatException: For input string: "200.0dip"

你正在使用的随机github库中有一个错误。 它不认为 200dp 是一个数字,大概是因为它不期望那里有 dp。 你将不得不自己修复它或联系作者,看看他是否愿意这样做。 或者不使用 dp,并以某种方式围绕缩放问题编写代码。

相关内容

最新更新