没有合适的资源?快使用搜索试试~ 我知道了~
利用MVC编写广告条轮播效果
0 下载量 10 浏览量
2021-01-20
10:38:50
上传
评论
收藏 68KB PDF 举报
温馨提示
试读
5页
我理解的安卓中MVC思想是利用Holder进行编程,展示布局,提供视图,将视图和数据进行绑定起来,在很多App中我们能见到广告条,广告条这里我们可以使用FramLayout进行填充,然后利用MVC的思想将提供的布局添加到FrameLayout中即可; 广告条的实现也可以利用Banner等开源框架等,这里就不列举了,感兴趣的朋友可以去搜下 当然由于我这里的项目的图片是设计师那边提供好的,并不是从网上获取的,所以我这里就直接写了ViewPager来进行填充了 <!--轮播图--> <RelativeLayout android:layout_width=match_parent
资源详情
资源评论
资源推荐
利用利用MVC编写广告条轮播效果编写广告条轮播效果
我理解的安卓中MVC思想是利用Holder进行编程,展示布局,提供视图,将视图和数据进行绑定起来,在很多App中我们能见到广告
条,广告条这里我们可以使用FramLayout进行填充,然后利用MVC的思想将提供的布局添加到FrameLayout中即可; 广告条的
实现也可以利用Banner等开源框架等,这里就不列举了,感兴趣的朋友可以去搜下
当然由于我这里的项目的图片是设计师那边提供好的,并不是从网上获取的,所以我这里就直接写了ViewPager来进行填充了
<!--轮播图-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="328px">
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fragment_work_pic_viewpager"/>
<!-- 指针容器 -->
<RelativeLayout
android:background="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:layout_alignBottom="@id/fragment_work_pic_viewpager">
<!--<TextView
android:textSize="12sp"
android:layout_gravity="left"
android:layout_marginLeft="5dp"
android:id="@+id/tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:text="图片的描述"/>-->
<LinearLayout
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:id="@+id/ll_dots"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
</LinearLayout>
</RelativeLayout>
逻辑:
package com.hanzheng.znxl.fragment;
import android.support.v4.view.ViewPager;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.hanzheng.znxl.R;
import com.hanzheng.znxl.adapter.OnPagerChangeListenerImp;
import com.hanzheng.znxl.adapter.WorkFragmentBannerAdapter;
import com.hanzheng.znxl.base.BaseFragment;
import com.hanzheng.znxl.base.MyApplication;
import com.hanzheng.znxl.utils.ToastUtil;
import butterknife.Bind;
import butterknife.ButterKnife;
weixin_38590996
- 粉丝: 8
- 资源: 929
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0