Andorid之TabLayout+ViewPager

news2025/5/16 3:30:02

文章目录

  • 前言
  • 一、效果图
  • 二、使用步骤
    • 1.主xml布局
    • 2.activity代码
    • 3.MyTaskFragment代码
    • 4.MyTaskFragment的xml布局
    • 5.Adapter代码
    • 6.item布局
  • 总结


前言

TabLayout+ViewPager功能需求已经是常见功能了,我就不多解释了,需要的自取。


一、效果图

在这里插入图片描述

二、使用步骤

1.主xml布局

代码如下(示例):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/backColor"
    android:orientation="vertical">

    <include layout="@layout/title_hslayout" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="44dp"
        android:background="#ffFFE7CB"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="15dp"
            android:src="@mipmap/ico_xlb" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:text="请勿恶意提交订单,被举报核实将面临封号封设备处罚!"
            android:textColor="#ff981c"
            android:textSize="13dp" />
    </LinearLayout>

    <com.google.android.material.tabs.TabLayout
        android:id="@+id/tablayout"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:overScrollMode="never"
        app:tabIndicator="@mipmap/ico_jdt"
        app:tabIndicatorColor="#02C7AB"
        app:tabIndicatorFullWidth="false"
        app:tabMode="fixed"
        app:tabIndicatorHeight="4dp"
        app:tabRippleColor="@null"
        app:tabSelectedTextColor="#02C7AB"
        app:tabTextAppearance="@style/TabLayoutTextStyleys"
        app:tabTextColor="#66061C1A"></com.google.android.material.tabs.TabLayout>

    <androidx.viewpager.widget.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:overScrollMode="never" />
</LinearLayout>

2.activity代码

这里需要注意的是继承FragmentActivity()。

class MyTask : FragmentActivity(), View.OnClickListener {
    private lateinit var imag_fh: ImageView
    private lateinit var text_title: TextView
    private lateinit var tablayout: TabLayout
    private lateinit var viewpager: ViewPager
    private lateinit var titlelist: List<String>
    private lateinit var fragments: MutableList<Fragment>
    private lateinit var adapter: MyTaskAdapter
    private lateinit var message: String

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        //去掉状态栏
        if (Build.VERSION.SDK_INT >= 21) {
            val decorView = window.decorView
            val option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
            decorView.systemUiVisibility = option
            window.statusBarColor = Color.parseColor("#00000000")
        }
        setContentView(R.layout.mytask)
        initView()
    }

    fun initView() {
        fragments = mutableListOf()
        imag_fh = findViewById(R.id.imag_fh)
        text_title = findViewById(R.id.text_title)
        text_title.text = "我的任务"
        tablayout = findViewById(R.id.tablayout)
        viewpager = findViewById(R.id.viewpager)
        titlelist = listOf(
            "待提交",
            "审核中",
            "已通过",
            "未通过",
            "复审中"
        )
        for (i in titlelist.indices) {
            val fragment = MyTaskFragment()
            fragments.add(fragment)
        }
        adapter =
            MyTaskAdapter(
                fragments,
                titlelist,
                supportFragmentManager,
                this@MyTask
            )
        viewpager.adapter = adapter
        tablayout.setupWithViewPager(viewpager)
        tablayout.setSelectedTabIndicatorFixWidth(60f)
        tablayout.setSelectedTabIndicatorFixWidth(60f)
        //让tab充满屏幕
//        tablayout.tabMode = TabLayout.MODE_FIXED;
//        tablayout.tabGravity = TabLayout.GRAVITY_FILL;
        tablayout.addOnTabSelectedListener(object :
            TabLayout.OnTabSelectedListener {
            override fun onTabSelected(tab: TabLayout.Tab?) {
                handlerTabLayoutBold(tab, true)
            }

            override fun onTabUnselected(tab: TabLayout.Tab?) {
                handlerTabLayoutBold(tab, false)
            }

            override fun onTabReselected(tab: TabLayout.Tab?) {
            }
        })
        for (i in 0 until tablayout.tabCount) {
            val tab: TabLayout.Tab? = tablayout.getTabAt(i)
            if (tab != null) {
                tab.view.isLongClickable = false
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
                    tab.view.tooltipText = null // 或者设置空字符串 ""
                }
            }
        }
        imag_fh.setOnClickListener(this)
    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.imag_fh -> finish()
        }
    }

    /**
     * 设置指示符固定宽度
     */
    fun TabLayout.setSelectedTabIndicatorFixWidth(width: Float) {
        setSelectedTabIndicator(object : DrawableWrapper(tabSelectedIndicator) {
            override fun setBounds(left: Int, top: Int, right: Int, bottom: Int) {
                var realLeft = left
                var realRight = right
                if ((right - left).toFloat() != width) {
                    val center = left + (right - left).toFloat() / 2
                    realLeft = (center - width / 2).toInt()
                    realRight = (center + width / 2).toInt()
                }
                super.setBounds(realLeft, top, realRight, bottom)
            }
        })
    }

    /** 修改单独某一个的粗细*/
    fun handlerTabLayoutBold(tab: TabLayout.Tab?, isBold: Boolean) {
        tab?.view?.forEach { view ->
            if (view is TextView) {
                if (isBold) {
                    view.typeface = Typeface.DEFAULT_BOLD
                } else {
                    view.typeface = Typeface.DEFAULT
                }
            }
        }
    }
}

3.MyTaskFragment代码

/**
 * @Author : CaoLiulang
 * @Time : 2025/5/10 11:27
 * @Description :待提交fragment
 */
class MyTaskFragment() : Fragment(), OnClickListener {

    private var rootView: View? = null
    private var firstLoad = false
    private var isKeyboardVisible = false
    private lateinit var fbrefresh: SmartRefreshLayout//刷新
    private lateinit var clssheader: ClassicsHeader//刷新头
    private lateinit var classicsfooter: ClassicsFooter//加载
    private var pageNum = 1
    private lateinit var list_view: RecyclerView
    private lateinit var adapter: MyYSAdapter1
    private lateinit var list: MutableList<String>

    @Nullable
    override fun onCreateView(
        inflater: LayoutInflater,
        @Nullable container: ViewGroup?,
        @Nullable savedInstanceState: Bundle?
    ): View? {
        firstLoad = true//视图创建完成,将变量置为true
        rootView = inflater.inflate(R.layout.mytaskfragment, container, false)
        return rootView
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        list = mutableListOf()
        for (i in 1..10) {
            list.add("任务名称$i")
        }
        clssheader = ClassicsHeader(requireActivity())
        classicsfooter = ClassicsFooter(requireActivity())
        fbrefresh = rootView!!.findViewById(R.id.fbrefresh)
        fbrefresh.isEnableRefresh = true //是否启用下拉刷新
        fbrefresh.isEnableLoadMore = true //是否启用上拉加载功能
        //刷新
        fbrefresh.setOnRefreshListener {
            pageNum = 1
        }
        //加载
        fbrefresh.setOnLoadMoreListener {
            pageNum++
        }
        list_view = rootView!!.findViewById(R.id.list_view)
        list_view.layoutManager = LinearLayoutManager(
            requireActivity(),
            LinearLayoutManager.VERTICAL,
            false
        ) //竖向显示
        adapter = MyYSAdapter1(list, requireActivity())
        list_view.adapter = adapter
        if (userVisibleHint) {//判断Fragment是否可见
            firstLoad = false//将变量置为false
        }
    }

    override fun onDestroyView() {
        super.onDestroyView()
        firstLoad = false //视图销毁将变量置为false
    }

    override fun setUserVisibleHint(isVisibleToUser: Boolean) {
        super.setUserVisibleHint(isVisibleToUser)
        if (firstLoad && isVisibleToUser) { //视图变为可见并且是第一次加载
            firstLoad = false
        }
    }

    override fun onDestroy() {
        super.onDestroy()
    }

    override fun onClick(v: View?) {
        when (v?.id) {
        }
    }

}

4.MyTaskFragment的xml布局

这里我加了分页刷新,自己看是否需要。

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

    <com.scwang.smartrefresh.layout.SmartRefreshLayout
        android:id="@+id/fbrefresh"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="12dp"
        android:layout_marginRight="5dp"
        android:layout_marginBottom="12dp"
        app:srlEnableLoadMoreWhenContentNotFull="false">

        <com.hzwl.aidigital.utils.ClassicsHeader
            android:id="@+id/clssheader"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/list_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:overScrollMode="never" />


        <com.hzwl.aidigital.utils.ClassicsFooter
            android:id="@+id/classicsfooter"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.scwang.smartrefresh.layout.SmartRefreshLayout>

</LinearLayout>

5.Adapter代码

public class MyYSAdapter1 extends RecyclerView.Adapter<MyYSAdapter1.ViewHolder> {
    private List<String> list;
    private Context context;


    public MyYSAdapter1(List<String> list, Context context) {
        this.list = list;
        this.context = context;
    }

    /**
     * 加载更多
     *
     * @param mPageList
     */
    public void setData(List<String> mPageList) {
        try {
            if (mPageList != null) {
                int previousSize = 0;
                try {
                    previousSize = list.size();
                } catch (Exception e) {
                    previousSize = 0;
                }
                int sizez = previousSize + 2;
                list.addAll(mPageList);
                notifyItemRangeInserted(sizez, mPageList.size());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.mytaskfragment_item, parent, false);
        ViewHolder viewHolder = new ViewHolder(view);
        return viewHolder;
    }

    /**
     * 类似GetView
     *
     * @param holder
     * @param position
     */
    @Override
    public void onBindViewHolder(final ViewHolder holder, @SuppressLint("RecyclerView") final int position) {
        holder.text_name.setText(list.get(position));
    }

    //添加元素,需要告诉UI线程布局的变动
    public void update() {
        notifyDataSetChanged();
    }

    /**
     * 长度
     *
     * @return
     */
    @Override
    public int getItemCount() {
        return list.size();
    }

    /**
     * 初始化组件
     */
    class ViewHolder extends RecyclerView.ViewHolder {
        TextView text_name;

        public ViewHolder(final View itemView) {
            super(itemView);
            text_name = itemView.findViewById(R.id.text_name);
        }
    }
}

6.item布局

<?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="wrap_content"
    android:background="@color/backColor"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:layout_marginRight="5dp"
        android:background="@drawable/bzhs_fff_10">

        <RelativeLayout
            android:id="@+id/relative_top"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="15dp">

            <ImageView
                android:id="@+id/iamg_tp"
                android:layout_width="56dp"
                android:layout_height="56dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="15dp"
                android:src="@mipmap/ico_hometb" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="11dp"
                android:layout_marginRight="11dp"
                android:layout_toRightOf="@+id/iamg_tp"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/text_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="任务名称任务名..."
                    android:textColor="#061C1A"
                    android:textSize="16dp"
                    android:textStyle="bold" />

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="审核编号:"
                        android:textColor="#66061C1A"
                        android:textSize="12dp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="23435"
                        android:textColor="#232323"
                        android:textSize="12dp" />

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="5dp"
                        android:src="@mipmap/ico_fzal" />
                </LinearLayout>

            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginRight="20dp"
                android:gravity="right"
                android:orientation="vertical">

                <LinearLayout
                    android:id="@+id/linear_yb"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="+"
                        android:textColor="#FA5151"
                        android:textSize="14dp" />

                    <TextView
                        android:id="@+id/text_num"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="20"
                        android:textColor="#FA5151"
                        android:textSize="24dp"
                        android:textStyle="bold" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="元"
                        android:textColor="#FA5151"
                        android:textSize="14dp" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="horizontal">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="提交限时:"
                        android:textColor="#66061c1a"
                        android:textSize="12dp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="00:59:59"
                        android:textColor="#02C7AB"
                        android:textSize="12dp" />
                </LinearLayout>
            </LinearLayout>

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/relative_top"
            android:layout_marginLeft="15dp"
            android:layout_marginBottom="15dp"
            android:layout_marginRight="10dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="接单时间:"
                    android:textColor="#66061c1a"
                    android:textSize="12dp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="2025-05-08 15:01:08"
                    android:textColor="#232323"
                    android:textSize="12dp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:orientation="horizontal">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:layout_marginRight="5dp"
                    android:background="@drawable/bzhs_red_20"
                    android:gravity="center"
                    android:paddingLeft="15dp"
                    android:paddingTop="5dp"
                    android:paddingRight="15dp"
                    android:paddingBottom="5dp"
                    android:text="放弃任务"
                    android:textColor="#ffffff"
                    android:textSize="12dp" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"
                    android:background="@drawable/bzhs_lvse_20"
                    android:gravity="center"
                    android:paddingLeft="15dp"
                    android:paddingTop="5dp"
                    android:paddingRight="15dp"
                    android:paddingBottom="5dp"
                    android:text="提交任务"
                    android:textColor="#ffffff"
                    android:textSize="12dp" />
            </LinearLayout>
        </RelativeLayout>

        <ImageView
            android:id="@+id/iamg_bq"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:src="@mipmap/ico_tuijian" />
    </RelativeLayout>

</LinearLayout>

总结

总之来说TabLayout+ViewPager没有什么技术难点,需要注意的是TabLayout的item是否铺满屏幕需要xml控制或者代码动态控制,代码都附上了。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2376550.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

26考研——中央处理器_指令流水线_流水线的冒险与处理 流水线的性能指标 高级流水线技术(5)

408答疑 文章目录 六、指令流水线流水线的冒险与处理结构冒险数据冒险延迟执行相关指令采用转发&#xff08;旁路&#xff09;技术load-use 数据冒险的处理 控制冒险 流水线的性能指标流水线的吞吐率流水线的加速比 高级流水线技术超标量流水线技术超长指令字技术超流水线技术 …

酒店旅游类数据采集API接口之携程数据获取地方美食品列表 获取地方美餐馆列表 景点评论

携程 API 接入指南 API 地址&#xff1a; 调用示例&#xff1a; 美食列表 景点列表 景点详情 酒店详情 参数说明 通用参数说明 请谨慎传递参数&#xff0c;避免不必要的费用扣除。 URL 说明&#xff1a;https://api-gw.cn/平台/API类型/ 平台&#xff1a;淘宝&#xff0c;京…

Lora原理及实现浅析

Lora 什么是Lora Lora的原始论文为《LoRA: Low-Rank Adaptation of Large Language Models》&#xff0c;翻译为中文为“大语言模型的低秩自适应”。最初是为了解决大型语言模在进行任务特定微调时消耗大量资源的问题&#xff1b;随后也用在了Diffusion等领域&#xff0c;用于…

【设计模式】- 创建者模式

单例模型 饿汉式 静态方法创建对象 public class Singleton {// 私有构造方法private Singleton(){}private static Singleton instance new Singleton();// 提供一个外界获取的方法public static Singleton getInstance(){return instance;} }静态代码块创建对象 public …

南审计院考研分享会 经验总结

汪学长 – 中科大 计科专硕 初试准备 数学先做真题&#xff0c;模拟题刷的越多分越高&#xff1b;408真题最重要&#xff0c;模拟题辅助&#xff1b;英语只做真题&#xff1b;政治9月份开始背 代码能力在低年级培养的重要性和路径 考研不选择机构原因 因为机构里面学习的框…

牛客练习赛138(首篇万字题解???)

赛时成绩如下&#xff1a; 1. 小s的签到题 小s拿到了一个比赛榜单&#xff0c;他要用最快的速度找到签到题&#xff0c;但是小s脑子还是有点晕&#xff0c;请你帮帮小s&#xff0c;助力他找到签到题。 比赛榜单是一个 2 行 n 列的表格&#xff1a; 第一行是 n 个大写字母&#…

用git下载vcpkg时出现Connection was reset时的处理

用git安装vcpkg时出现Connect was rest&#xff08;如上图&#xff09;。多谢这位网友的博文解决了问题&#xff1a; 通过:http.sslVerify false全局来设置&#xff0c;执行以下命令&#xff1a; git config --global http.sslVerify "false" 原文链接&#xff1a…

leetcode - 滑动窗口问题集

目录 前言 题1 长度最小的子数组&#xff1a; 思考&#xff1a; 参考代码1&#xff1a; 参考代码2&#xff1a; 题2 无重复字符的最长子串&#xff1a; 思考&#xff1a; 参考代码1&#xff1a; 参考代码2&#xff1a; 题3 最大连续1的个数 III&#xff1a; 思考&am…

一分钟在Cherry Studio和VSCode集成火山引擎veimagex-mcp

MCP的出现打通了AI模型和外部数据库、网页API等资源&#xff0c;成倍提升工作效率。近期火山引擎团队推出了 MCP Server SDK&#xff1a; veimagex-mcp。本文介绍如何在Cherry Studio 和VSCode平台集成 veimagex-mcp。 什么是MCP MCP&#xff08;Model Context Protocol&…

Tomcat与纯 Java Socket 实现远程通信的区别

Servlet 容器​​&#xff08;如 Tomcat&#xff09; 是一个管理 Servlet 生命周期的运行环境&#xff0c;主要功能包括&#xff1a; ​​协议解析​​&#xff1a;自动处理 HTTP 请求/响应的底层协议&#xff08;如报文头解析、状态码生成&#xff09;&#xff1b; ​​线程…

为什么企业建站或独立站选用WordPress

与大多数组织相比&#xff0c;企业业务更需要保持可扩展和可靠的网络存在&#xff0c;以保持竞争力。为此&#xff0c;许多大型企业的 IT 领导者历来寻求昂贵的网络解决方案&#xff0c;这些方案需要签订专有支持合同来保证质量。不过&#xff0c;还有另一种方法。WordPress问世…

镜头内常见的马达类型(私人笔记)

① 螺杆式马达 驱动来源&#xff1a;机身内马达。镜头尾部有一个接收“螺杆”的接口&#xff0c;通过机械传动带动镜头对焦组。缺点&#xff1a;慢、吵、不能用于无机身马达的相机。✅ 典型镜头&#xff1a;尼康 AF、AF-D 系列&#xff1b;美能达老镜头。尼康传统的AF镜头通过…

从代码学习深度学习 - 语义分割和数据集 PyTorch版

文章目录 前言什么是语义分割?图像分割和实例分割Pascal VOC2012 语义分割数据集Pascal VOC2012 语义分割数据集介绍基本信息语义分割部分特点数据格式评价指标应用价值数据集获取使用提示辅助工具代码 (`utils_for_huitu.py`)读取数据预处理数据自定义语义分割数据集类读取数…

4G物联网模块实现废气处理全流程数据可视化监控配置

一、项目背景 随着工业化进程的加速&#xff0c;工业废气的排放对环境造成了严重影响&#xff0c;废气处理厂应运而生。然而&#xff0c;废气处理厂中的设备众多且分散&#xff0c;传统的人工巡检和数据记录方式效率低下&#xff0c;难以及时发现问题。为了实现对废气处理设备…

电商平台如何做好DDoS 攻防战?

一、新型 DDoS 攻击技术演进分析 1.1 电商平台面临的四类攻击范式 graph LR A[DDoS攻击] --> B{网络层} A --> C{应用层} B --> D[CLDAP反射攻击<br>峰值达3.5Tbps] B --> E[QUIC协议洪水攻击] C --> F[API CC攻击<br>精准打击抢购接口] C -->…

【计算机视觉】OpenCV实战项目:Athlete-Pose-Detection 运动员姿态检测系统:基于OpenCV的实时运动分析技术

运动员姿态检测系统&#xff1a;基于OpenCV的实时运动分析技术 1. 项目概述1.1 技术背景1.2 项目特点 2. 技术架构与算法原理2.1 系统架构2.2 核心算法2.3 模型选择 3. 项目部署与运行指南3.1 环境准备硬件要求软件依赖 3.2 项目配置3.3 运行项目基本运行模式高级参数 4. 常见问…

为什么要选择七彩喜数字康养平台?加盟后有何优势?

一&#xff0e;七彩喜数字康养平台 1.技术领先性 七彩喜依托“端-网-云-脑”四层技术架构&#xff0c;整合毫米波雷达、AI算法引擎、区块链等前沿技术&#xff0c;解决传统养老的隐私泄露、设备孤岛等痛点。 比如非接触式健康监测系统通过毫米波雷达实现跌倒检测准确率&#…

【计算机视觉】OpenCV实战项目:基于OpenCV的车牌识别系统深度解析

基于OpenCV的车牌识别系统深度解析 1. 项目概述2. 技术原理与算法设计2.1 图像预处理1) 自适应光照补偿2) 边缘增强 2.2 车牌定位1) 颜色空间筛选2) 形态学操作3) 轮廓分析 2.3 字符分割1) 投影分析2) 连通域筛选 2.4 字符识别 3. 实战部署指南3.1 环境配置3.2 项目代码解析 4.…

鸿蒙接入flutter环境变量配置windows-命令行或者手动配置-到项目的创建-运行demo项目

鸿蒙接入flutter环境变量配置 参考官网 下载flutter git clone https://gitcode.com/openharmony-sig/flutter_flutter.git git checkout -b dev origin/dev # 国内镜像 export PUB_HOSTED_URLhttps://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URLhttps://storage.fl…

Flink CDC—实时数据集成框架

Flink CDC 是一个基于流的数据集成工具&#xff0c;旨在为用户提供一套功能更加全面的编程接口&#xff08;API&#xff09;&#xff0c;它基于数据库日志的 CDC&#xff08;变更数据捕获&#xff09;技术实现了统一的增量和全量数据读取。 该工具使得用户能够以 YAML 配置文件…