【问题标题】:Draggableview number fornat exception可拖动的Vue数字格式异常
【发布时间】:2018-10-19 15:02:42
【问题描述】:

下面是我的 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"

【问题讨论】:

    标签: android draggable


    【解决方案1】:

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多