导出完成后,我们就可以像使用其他JAR文件一样使用我们自己的自定义控件包了。下面给出一个小DEMO介绍如何使用这个JAR包。
步骤一:
新建文件夹lib,将jar 包放入。
步骤二:
关联JAR包,如下图:
步骤三,使用JAR包:
如下代码:
<LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"
xmlns:gif="http://schemas.android.com/apk/res/com.terry.jarTest"
android:id="@+id/layout" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<Button android:text="停止" android:id="@+id/Button01"
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="开始" android:id="@+id/Button02"
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<com.terry.gif.TypegifView
android:layout_width="fill_parent" android:id="@+id/gifView1"
gif:stop="true" android:layout_height="wrap_content"
gif:delay="1"></com.terry.gif.TypegifView>
</LinearLayout>
android:id="@+id/layout" android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<Button android:text="停止" android:id="@+id/Button01"
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<Button android:text="开始" android:id="@+id/Button02"
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<com.terry.gif.TypegifView
android:layout_width="fill_parent" android:id="@+id/gifView1"
gif:stop="true" android:layout_height="wrap_content"
gif:delay="1"></com.terry.gif.TypegifView>
</LinearLayout>
