ViewPager、Fragment和ListView的综合使用

这篇博客分享了如何在项目中综合使用ViewPager、Fragment和ListView。作者提到在布局文件main_index.xml中应用了这些组件,并指出使用FragmentActivity作为基类。尽管Fragment布局仅包含一个简单的ListView,但文中表达了作者对技术学习的热情,欢迎读者提出建议和指正。

人的一生,没有一味的苦,没有永远的痛;没有迈不过的坎,没有闯不过的关。

这是在浏览一篇博客时看到的,感觉很励志,就拿来跟大家共勉。

下面是主界面main_index.xml布局文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        >
    </android.support.v4.view.ViewPager>
    
    <View 
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@color/gray"
        />

    <LinearLayout 
        android:layout_width="match_parent"
        android:layout_height="50dp"
        >
        <LinearLayout 
            android:id="@+id/ll_contact"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:gravity="center_horizontal"
            >
            <ImageView 
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_marginTop="2dp"
                android:src="@drawable/contact"
                />
            <TextView 
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/contact"
                />
        </LinearLayout>
        
        <View 
            android:layout_width="1dp"
            android:layout_height="match_parent"
            android:background="@color/gray"
            />
        
        <LinearLayout 
            android:id="@+id/ll_project"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="match_paren
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值