Tablayout+fragment+viewpager

先导依赖

compile 'com.bigkoo:convenientbanner:2.0.5'
compile 'com.android.support:design:23.4.0'
compile 'com.jwenfeng.pulltorefresh:library:1.0.3'
布局 

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    tools:context="com.example.yue2application.MainActivity">
    <android.support.v4.widget.DrawerLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/dl"
        >
        <LinearLayout
            android:layout_width="300dp"
            android:layout_height="match_parent"
          android:background="#2d7bda"
            android:layout_gravity="left"
            android:orientation="vertical"
            >
            <ImageView
                android:layout_width="100dp"
                android:layout_height="100dp"
                android:src="@drawable/a"/>
            <TextView
                android:id="@+id/tv0"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="强哥"/>
            <TextView
                android:id="@+id/tv01"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="月考练习"/>
            <TextView
                android:id="@+id/tv1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="练习第一次"/>
            <TextView
                android:id="@+id/tv2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/tv1"
                android:text="练习第二次"/>
            <TextView
                android:id="@+id/tv3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/tv2"
                android:text="练习第三次"/>
            <TextView
                android:id="@+id/tv4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/tv3"
                android:text="练习第四次"/>
            <TextView
                android:id="@+id/tv5"
                android:layout_width="match_parent"
                android:layout_below="@id/tv4"
                android:layout_height="wrap_content"
                android:text="练习第五次"/>

        </LinearLayout>
  <RelativeLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"

      >
      <LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/ll"
          android:orientation="horizontal"
          android:layout_alignParentBottom="true"
          >
          <Button
              android:id="@+id/sy"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="1"
              android:gravity="center"
              android:text="首页" />

          <Button
              android:id="@+id/qy"
              android:layout_width="0dp"
              android:layout_height="match_parent"
              android:layout_weight="1"
              android:gravity="center"
              android:text="详情页" />

      </LinearLayout>
      <FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_above="@id/ll"
          android:id="@+id/fl"
          android:layout_alignParentStart="true"></FrameLayout>

  </RelativeLayout>
    </android.support.v4.widget.DrawerLayout>

</RelativeLayout>
gitem布局

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >
<ImageView
    android:layout_width="100dp"
    android:layout_height="100dp"
    android:id="@+id/img"
    />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/tv1"
        />
</LinearLayout>
item布局

<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:layout_width="100dp"
     android:layout_height="100dp"
     android:id="@+id/img"
     />
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/tv1">

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

        <TextView
            android:id="@+id/tv2"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true" />
    </RelativeLayout>
</LinearLayout>
item2布局

<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/img1"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="100dp" />
    <ImageView
        android:id="@+id/img2"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="100dp" />
    <ImageView
        android:id="@+id/img3"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="100dp" />


</LinearLayout>
litem布局

<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/img"
        android:layout_width="100dp"
        android:layout_height="100dp" />
    <TextView
        android:layout_marginTop="45dp"
        android:id="@+id/tv1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>
news 刷新的布局

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

    <com.jwenfeng.library.pulltorefresh.PullToRefreshLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/pull">

        <ListView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/list_view"></ListView>
    </com.jwenfeng.library.pulltorefresh.PullToRefreshLayout>
</LinearLayout>
qiyuf布局

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

    >
    <android.support.design.widget.TabLayout
        android:layout_width="match_parent"
        android:layout_height="60dp"
        app:tabMode="scrollable"
        android:id="@+id/tl"
        app:tabIndicatorHeight="5dp"
        app:tabSelectedTextColor="@color/colorAccent"
        app:tabIndicatorColor="#3238d5"
        app:tabTextColor="#797474"
        >

    </android.support.design.widget.TabLayout>
    <android.support.v4.view.ViewPager
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/vp"
        ></android.support.v4.view.ViewPager>

</LinearLayout>
shouye布局

<com.jwenfeng.library.pulltorefresh.PullToRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:id="@+id/prl"
    android:layout_height="match_parent"
    android:background="#1be150">


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.bigkoo.convenientbanner.ConvenientBanner
            android:id="@+id/cb"
            android:layout_width="match_parent"
            android:layout_height="200dp"
            app:canLoop="true"></com.bigkoo.convenientbanner.ConvenientBanner>

        <GridView
            android:id="@+id/gv"
            android:layout_below="@id/cb"
            android:layout_width="match_parent"
            android:layout_height="130dp"
            android:numColumns="4"></GridView>

        <ListView
            android:id="@+id/lv"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@id/gv"></ListView>
    </RelativeLayout>

</com.jwenfeng.library.pulltorefresh.PullToRefreshLayout>

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值