安卓_XListVicw加载更多和无限轮播点_2

本文提供了四个不同的XML布局文件示例,包括使用ViewPager的vp_item.xml、包含ImageView和TextView的xlv_item.xml、含有XListView的main.xml以及简单的activity_main.xml布局。通过这些示例,读者可以了解如何创建不同类型的UI组件并进行布局。

1、vp_item.xml

///////////

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">




    <android.support.v4.view.ViewPager
        android:id="@+id/vp"
        android:layout_width="match_parent"
        android:layout_height="200dp">


    </android.support.v4.view.ViewPager>


    <LinearLayout
        android:id="@+id/ll"


        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:gravity="center"
        android:orientation="horizontal">


    </LinearLayout>


</RelativeLayout>


2、xlv_item.xml

///////////////////

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">


    <ImageView
        android:id="@+id/xlv_iv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


    <TextView
        android:id="@+id/xlv_tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


</LinearLayout>


3、/////////

main.xml


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#f0f0f0"
    android:orientation="vertical">


    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/hello" />


    <me.maxwin.view.XListView
        android:id="@+id/xListView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:cacheColorHint="#00000000">


    </me.maxwin.view.XListView>


</LinearLayout>



4、activity_main.xml


<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <com.sujichun.user.XListView
        android:id="@+id/xlv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
         />


</LinearLayout>


strings.xml***
、、、、

<?xml version="1.0" encoding="utf-8"?>
<resources>


    <string name="hello">Hello World, XListViewActivity!</string>
    <string name="app_name">XListView</string>
    <string name="xlistview_header_hint_normal">下拉刷新</string>
    <string name="xlistview_header_hint_ready">松开刷新数据</string>
    <string name="xlistview_header_hint_loading">正在加载...</string>
    <string name="xlistview_header_last_time">上次更新时间:</string>
    <string name="xlistview_footer_hint_normal">查看更多</string>
    <string name="xlistview_footer_hint_ready">松开载入更多</string>


</resources>

////////////////////
dot_focus.xml


<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">


    <corners android:radius="8dp"></corners>
    <solid android:color="#f00"></solid>


</shape>

-------------

dot_normal.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">


    <corners android:radius="8dp"></corners>
    <solid android:color="#00ff00"></solid>


</shape>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值