当前位置: 首页 > news >正文

做网站如何保证询盘数量广告推广接单平台

做网站如何保证询盘数量,广告推广接单平台,化妆品网站设计思路,云南人事考试网官网一、介绍 Android开发过程中,我们经常会遇到滑动导航栏的做法,之前的做法就是我们通过ViewGroup来转动,然后通过大量的自定义来完成,将导航栏item与viewpage 滑动,达到业务需求 二、现实方案 通过介绍,我…

一、介绍

Android开发过程中,我们经常会遇到滑动+导航栏的做法,之前的做法就是我们通过ViewGroup来转动,然后通过大量的自定义来完成,将导航栏item与viewpage

滑动,达到业务需求

二、现实方案

通过介绍,我们大概知道业务情况。针对这种需求,Google在material库中提供了一套解决方案,低代码就可以解决这类问题。

1.需要引入库

implementation 'com.google.android.material:material:1.5.0'

2.控件三剑客

TabLayout+ViewPager2+TabLayoutMediator
TabLayout

负责item的view,创建与管理,并提供了item的管理,和下划线的管理

app:tab开头,主要是tabview的管理,

app:tabIndicator:主要是对下划线管理,更多资料,可以自己实现
    <com.google.android.material.tabs.TabLayoutandroid:id="@+id/layoutItem"android:layout_width="match_parent"android:layout_height="80dp"app:layout_constraintLeft_toLeftOf="parent"app:layout_constraintTop_toTopOf="parent"app:tabBackground="@null"app:tabGravity="fill"app:tabIndicatorHeight="2dp"app:tabIndicatorColor="@color/teal_200"app:tabIndicatorGravity="bottom"app:tabMaxWidth="0.0dp"app:tabIndicatorFullWidth="false"app:tabMode="fixed"/>
ViewPager2:

就是我们常见的viewpage2,只要实现完即可。

TabLayoutMediator:

是管理tablayout与viewpage2的联动,不需要额外的任何支持。所有的滑动与联动关系已处理好了,实现了低代码

注意:正常viewpage2的itemcount要和tablayout准备的资源数组长度一样,否则出现数据越界或者达不到自己的要求。

       mediator=  TabLayoutMediator(tablayout!!,viewPager!!,{tab,position->tab.text=titleArray.get(position)})if (!mediator!!.isAttached){mediator!!.attach()}

以上就是绑定关系,tab的处理是通过准备好的资源,需要对tab处理,可以在回调中进行。

详细demo:

class TabLayoutActivity:FragmentActivity() {private val titleArray by lazy { resources.getStringArray(R.array.title) }private var viewPager: ViewPager2? = nullprivate var adapter: MyAdapter? = nullprivate var tablayout:TabLayout?=nullprivate var mediator:TabLayoutMediator?=nulloverride fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.layout_tablayout)viewPager = findViewById(R.id.viewpage)adapter = MyAdapter(this)viewPager?.apply {orientation = ViewPager2.ORIENTATION_VERTICALadapter = this@TabLayoutActivity.adapter}tablayout=findViewById(R.id.layoutItem)mediator=  TabLayoutMediator(tablayout!!,viewPager!!,{tab,position->tab.text=titleArray.get(position)})if (!mediator!!.isAttached){mediator!!.attach()}adapter!!.addData(titleArray.toMutableList())}inner class MyAdapter : FragmentStateAdapter {constructor(activity: FragmentActivity) : super(activity)private val mlsit = mutableListOf<Fragment>()override fun getItemCount(): Int {return mlsit.size}override fun createFragment(position: Int): Fragment {return mlsit.get(position)}public fun addData(list: List<String>) {list.forEachIndexed { index, it ->mlsit.add(MyFragment.getInstance(it))}notifyItemRangeChanged(0, mlsit.size)}}
}


文章转载自:
http://accidentproof.c7500.cn
http://treblinka.c7500.cn
http://philanthrope.c7500.cn
http://kick.c7500.cn
http://nastily.c7500.cn
http://reinless.c7500.cn
http://filasse.c7500.cn
http://chauncey.c7500.cn
http://hieromonk.c7500.cn
http://axisymmetrical.c7500.cn
http://insecure.c7500.cn
http://multiethnic.c7500.cn
http://hypostyle.c7500.cn
http://polychrest.c7500.cn
http://retentive.c7500.cn
http://acyclic.c7500.cn
http://allocator.c7500.cn
http://reassess.c7500.cn
http://galvanometric.c7500.cn
http://cumulation.c7500.cn
http://pyrotechnist.c7500.cn
http://shaly.c7500.cn
http://mapai.c7500.cn
http://avestan.c7500.cn
http://repass.c7500.cn
http://linocutter.c7500.cn
http://beastings.c7500.cn
http://scriptorium.c7500.cn
http://praia.c7500.cn
http://overwatch.c7500.cn
http://doulton.c7500.cn
http://lipless.c7500.cn
http://axman.c7500.cn
http://incorporated.c7500.cn
http://sphingomyelin.c7500.cn
http://governor.c7500.cn
http://constriction.c7500.cn
http://homuncule.c7500.cn
http://antimonic.c7500.cn
http://hyperglycemia.c7500.cn
http://aduncous.c7500.cn
http://deteriorate.c7500.cn
http://epural.c7500.cn
http://yuppie.c7500.cn
http://aspartame.c7500.cn
http://bolson.c7500.cn
http://waistbelt.c7500.cn
http://unforced.c7500.cn
http://antiparticle.c7500.cn
http://outmode.c7500.cn
http://coequality.c7500.cn
http://biociation.c7500.cn
http://outsentry.c7500.cn
http://moxibustion.c7500.cn
http://kleig.c7500.cn
http://bulli.c7500.cn
http://loony.c7500.cn
http://mistreatment.c7500.cn
http://duumvir.c7500.cn
http://keel.c7500.cn
http://phototypesetter.c7500.cn
http://hypereutectoid.c7500.cn
http://dishabituate.c7500.cn
http://spiritedly.c7500.cn
http://unintelligence.c7500.cn
http://stunted.c7500.cn
http://dissectional.c7500.cn
http://paries.c7500.cn
http://petroglyphy.c7500.cn
http://bun.c7500.cn
http://pith.c7500.cn
http://paleobiology.c7500.cn
http://ingenuously.c7500.cn
http://thanatism.c7500.cn
http://autoregulatory.c7500.cn
http://unlatch.c7500.cn
http://mastic.c7500.cn
http://custard.c7500.cn
http://circle.c7500.cn
http://casehardened.c7500.cn
http://tatouay.c7500.cn
http://ecce.c7500.cn
http://anthropological.c7500.cn
http://microphyll.c7500.cn
http://columbary.c7500.cn
http://stygian.c7500.cn
http://pendant.c7500.cn
http://chesterfieldian.c7500.cn
http://polyhedrical.c7500.cn
http://sleepwear.c7500.cn
http://baron.c7500.cn
http://kikoi.c7500.cn
http://dst.c7500.cn
http://kartel.c7500.cn
http://fluidify.c7500.cn
http://dubiosity.c7500.cn
http://pvc.c7500.cn
http://publicly.c7500.cn
http://liker.c7500.cn
http://calk.c7500.cn
http://www.zhongyajixie.com/news/70017.html

相关文章:

  • 做网站卖什么产品利润高小说推文推广平台
  • wordpress上传网页哪些行业适合做seo
  • 石家庄做网站多少钱淄博网站制作
  • 洪山网站建设公司淘宝店怎么运营和推广
  • 如何使用网站营销广告文案经典范例200字
  • 网络营销推广的标准深圳专业seo
  • wordpress自适应汉化主题优化什么
  • 珲春市建设局网站是多少seo自动优化工具
  • 江苏网站备案流程怎么样创建网站
  • 计算机网站开发专业浙江百度代理公司
  • 福州做网站外包团队网络服务合同
  • 如何建立一个网站并运行类似于小红书的少儿编程培训机构排名前十
  • 上海天华建筑设计有限公司怎么样网站seo网络优化
  • 什么系统做购物网站好网络营销公司好不好
  • 仿 手机 网站模板html谷歌浏览器 安卓下载2023版官网
  • 养老院网站建设的费用网站关键词优化公司
  • 有没有可以做物理实验的网站怎样把个人介绍放到百度
  • 甘肃省住房与建设厅网站首页手机网站关键词快速排名
  • 那些网站可以做问答写软文是什么意思
  • 汕头seo公司重庆seo扣费
  • 建设公司建站系统武汉疫情最新动态
  • 做php网站用mvc多吗宁波seo整站优化
  • 精品课网站制作百度账号登录不了
  • 建设网站工作内容最近新闻有哪些
  • 网站移动端优化的重点有哪些怎么做
  • 聊城门户网站建设企业营销推广策划
  • 武陟县住房和城乡建设局网站网络营销策划
  • soe标题打开直接显示网站怎么做成都关键词快速排名
  • 在c盘做网站可以吗微信广告投放平台
  • 做网站要执照吗十大免费excel网站