android中使用别人的UI框架

android中使用别人的UI框架(针对有自定义属性)

在主工程直接使用(子UI的代码在主工程当中) xmlns:my  直接在主工程里的写法
com.gsta.v2.activity 是主工程包名
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:my="http://schemas.android.com/apk/res/com.gsta.v2.activity"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/white"
    android:orientation="vertical" >

    <include layout="@layout/title_bar" />

    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <include
            android:id="@+id/nodata"
            layout="@layout/nomore" />

        <com.gsta.v2.ui.PullToRefreshListView
            android:id="@+id/lv_1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:cacheColorHint="#00000000"
            android:clickable="true"
            android:fadingEdge="none"
            my:ptrTag="pl_phone" >
        </com.gsta.v2.ui.PullToRefreshListView>
    </FrameLayout>
</LinearLayout>



       如果下拉刷新UI框架代码全在子工程中,在主工程中使用的写法
com.siqiao.sdk.pull_listview.ui 子UI所在的文件夹目录(不使用子工程的包名:可能是因为打包时,子工程的代码都到主工程当中了,不能在子工程的包名中去找)
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:my="http://com.siqiao.sdk.pull_listview.ui/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/white"
    android:orientation="vertical" >

    <include layout="@layout/title_bar" />

    <FrameLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <include
            android:id="@+id/nodata"
            layout="@layout/nomore" />

        <com.siqiao.sdk.pull_listview.ui.PullToRefreshListView
            android:id="@+id/lv_1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:cacheColorHint="#00000000"
            android:clickable="true"
            android:fadingEdge="none"
            my:ptrTag="pl_phone" >
        </com.siqiao.sdk.pull_listview.ui.PullToRefreshListView>
    </FrameLayout>
</LinearLayout>

猜你喜欢

转载自201206135726.iteye.com/blog/2204603
今日推荐