0

我在我的项目中使用这个库和自定义 ImageView,它能够处理捏缩放和双击缩放事件:https ://github.com/jasonpolites/gesture-imageview 。我需要更改该库的源代码,因为我想将它与 ViewPager 一起使用。问题是当我在库中修改自定义视图的源代码时,然后我将此修改后的自定义视图添加到 XML 文件中的布局中,如下所示:

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gesture-image="http://schemas.polites.com/android"
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" 
android:background="#000000">
<com.polites.android.GestureImageView
    android:id="@+id/image"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
    gesture-image:min-scale="0.75"
    gesture-image:max-scale="10.0"
    android:src="@drawable/image"/>
</LinearLayout>

我的更改不想出现,我通过将所有值从 0 更改为 100 来破坏源代码(用于测试),当我以编程方式创建布局时,我的更改出现,并且自定义视图按我的假设工作,但是当我定义布局时在 XML 中没有任何效果,即使我从 XML 布局中的源代码自定义视图中清理了一些库的 java 文件,仍然可以像源代码没有变化一样工作。

4

1 回答 1

0

您是否尝试过Project => Clean您的主要项目和图书馆?

于 2013-09-23T22:11:55.457 回答