Android列表组件api

news2024/10/12 16:56:07

目录

1.ListView控件

1)android:divider

2)android:dividerHeight

3)android:entries

4)android:footerDividersEnabled

5)android:headerDividersEnabled

6)android:listSelector

7)android:scrollbars

8)android:smoothScrollbar

9)android:stackFromBottom

10)android:transcriptMode

11)android:cacheColorHint

12)android:choiceMode

13)android:drawSelectorOnTop

14)android:fadingEdge

15)android:fadingEdgeLength

16)android:fastScrollEnabled

17)android:fastScrollAlwaysVisible

18)android:scrollingCache

 19 java中操作

20.ListView的简单使用

1.代码

1-xml布局代码

2-java代码

3-适配器代码

2.效果

2.RecyclerView控件

1..属性

1)android:layout_width 和 android:layout_height

2)android:scrollbars

3)android:overScrollMode

4)android:nestedScrollingEnabled

5)android:clipToPadding

6)android:padding

7)app:layoutManager

8)app:spanCount

9)app:reverseLayout

10)app:stackFromEnd

2..Java/Kotlin 代码中的属性设置

1)设置 LayoutManager

2)设置 ItemAnimator

3)设置适配器

4)设置项目装饰

5)设置 HasFixedSize

6)设置 NestedScrollingEnabled

7)设置 OnScrollListener

8)设置 ItemTouchHelper

9)设置 OverScrollMode

10)设置 ItemViewCacheSize

11)设置 RecycledViewPool

12)设置 AccessibilityDelegateCompat

13)设置 EdgeEffectFactory

14)设置 Focusable 和 FocusableInTouchMode

15)设置 DescendantFocusability

16.案例:Recyclerview 的简单使用

1.代码

1-xml布局代码

2-java代码

3-适配器代码

2.效果


1.ListView控件

1)android:divider

设置列表项之间的分隔线的颜色

android:divider="@color/your_color"

2)android:dividerHeight

设置分隔线的高度。

android:dividerHeight="2dp"

3)android:entries

直接在 XML 文件中指定列表项的内容(通常用于简单的情况)。

android:entries="@array/your_array_resource"

4)android:footerDividersEnabled

是否在底部视图之前显示分隔线

android:footerDividersEnabled="true"

5)android:headerDividersEnabled

是否在顶部视图之后显示分隔线

android:headerDividersEnabled="false"

6)android:listSelector

设置当用户点击或触摸某个列表项时显示的选择器背景

android:listSelector="@drawable/your_selector_drawable"

7)android:scrollbars

指定哪些方向上应显示滚动条

android:scrollbars="vertical"

8)android:smoothScrollbar

启用平滑滚动条。

android:smoothScrollbar="true"

9)android:stackFromBottom

如果为 true,则从底部开始堆叠列表项;默认为 false。

android:stackFromBottom="true"

10)android:transcriptMode

设置转录模式,这对于聊天应用等场景很有用。

android:transcriptMode="alwaysScroll"

11)android:cacheColorHint

设置缓存颜色提示,影响滚动性能。

android:cacheColorHint="@null"  <!-- 或者指定其他颜色 -->

12)android:choiceMode

定义选择模式,如单选或多选。

android:choiceMode="singleChoice"  <!-- 可以是 "none", "singleChoice", "multipleChoice" -->

13)android:drawSelectorOnTop

选择器是否绘制在内容之上,默认为 false。

android:drawSelectorOnTop="true"

14)android:fadingEdge

设置渐变边缘效果的方向。

android:fadingEdge="vertical"

15)android:fadingEdgeLength

设置渐变边缘长度。

android:fadingEdgeLength="30dp"

16)android:fastScrollEnabled

启用快速滚动条。

android:fastScrollEnabled="true"

17)android:fastScrollAlwaysVisible

即使没有足够的项目也总是显示快速滚动条。

android:fastScrollAlwaysVisible="true"

18)android:scrollingCache

控制是否使用滚动缓存

android:scrollingCache="false"

 19 java中操作

// 设置适配器
listView.setAdapter(adapter);

// 设置选择模式
listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);

// 设置点击监听器
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        // 处理点击事件
    }
});

// 添加头部视图
listView.addHeaderView(headerView);

// 添加尾部视图
listView.addFooterView(footerView);

20.ListView的简单使用

1.代码
1-xml布局代码

my_list_view.xml文件内容

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:gravity="center"
    android:layout_gravity="center"

    android:layout_marginBottom="20dp"
    >

    <ImageView
        android:id="@+id/imageView"
        android:layout_width="256dp"
        android:layout_height="256dp"
        android:src="@drawable/a_girl" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="30dp"
        android:text="小女孩"
        android:textColor="#1781EB"
        android:id="@+id/textTittle"

        />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="15dp"
        android:text="这是一个手里拿着冰的小女孩"
        android:textColor="#F8055C"
        android:id="@+id/textContent"

        />
</LinearLayout>

activity_main.xml内容

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    tools:context=".MainActivity"
    android:layout_gravity="center"
    >

    <!--下面的控件居中-->

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:gravity="center"
        tools:ignore="MissingConstraints"
        >
        <ListView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/listView"
            tools:ignore="MissingConstraints"

            />

    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

2-java代码
package com.xiji.mylistview;

import android.os.Bundle;
import android.widget.ListView;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity extends AppCompatActivity {
    private MyListViewAdapter  myListViewAdapter;

    private ListView listView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });

        //创建适配器
        initView();
    }

    //初始化
    public void initView() {
        listView = findViewById(R.id.listView);
        myListViewAdapter = new MyListViewAdapter();
        listView.setAdapter(myListViewAdapter);


    }
}

3-适配器代码
package com.xiji.mylistview;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import org.w3c.dom.Text;

public class MyListViewAdapter extends BaseAdapter {

    private String[] titles = {"一个小女孩",
            "小男孩", 
            "小男孩2", 
            "小女孩1", 
            "小女孩2", 
            "小狗", 
            "蓝色小老鼠"};
    private String[] details = {"这是一个手里拿着水晶块的小女孩", 
            "这是一个穿着蓝色夹克的小男孩", 
            "这是一个穿着T恤衫的小男孩",
            "这是一个小女孩", "这是一个长耳朵的小女孩", 
            "这是一个穿着衣服的小狗", 
            "这是一只蓝色的小老鼠"};
    private int[] imagesInfos = {R.drawable.a_girl, 
            R.drawable.boy_one, 
            R.drawable.boy_two, 
            R.drawable.girl_one, 
            R.drawable.girl_two, 
            R.drawable.dog_one, 
            R.drawable.mouse};

    @Override
    public int getCount() {
        return titles.length; // 返回数组长度
    }

    @Override
    public Object getItem(int i) {
        return titles[i]; // 返回对应位置的标题
    }

    @Override
    public long getItemId(int i) {
        return i; // 返回索引作为 ID
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        // 这里可以添加自定义视图逻辑
        View inflate = View.inflate(parent.getContext(), R.layout.my_list_view, null);
        TextView textInfo = inflate.findViewById(R.id.textTittle);
        textInfo.setText(titles[position]);

        TextView textDetail = inflate.findViewById(R.id.textContent);
        textDetail.setText(details[position]);


        //图片
        ImageView imageView = inflate.findViewById(R.id.imageView);
        imageView.setImageResource(imagesInfos[position]);


        return inflate;
    }
}
   

2.效果

2.RecyclerView控件

1..属性

1)android:layout_widthandroid:layout_height

定义 RecyclerView 的宽度和高度。

android:layout_width="match_parent"
android:layout_height="match_parent"

2)android:scrollbars

指定滚动条的方向。

android:scrollbars="vertical"

3)android:overScrollMode

控制过度滚动的效果。

android:overScrollMode="always"  <!-- 可以是 "always", "ifContentScrolls", "never" -->

4)android:nestedScrollingEnabled

启用嵌套滚动,默认为 true。

android:nestedScrollingEnabled="true"

5)android:clipToPadding

是否将内容裁剪到内边距区域,默认为 true。

android:clipToPadding="false"

6)android:padding

设置 RecyclerView 的内边距。

android:padding="10dp"

7)app:layoutManager

通过 XML 设置 LayoutManager(需要使用 app 命名空间)。

app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"

8)app:spanCount

当使用 GridLayoutManager 时,设置每行/列的项数。

app:spanCount="2"

9)app:reverseLayout

反转布局方向。

app:reverseLayout="true"

10)app:stackFromEnd

从底部开始堆叠列表项。

app:stackFromEnd="true"

2..Java/Kotlin 代码中的属性设置

除了 XML 属性外,还可以通过 Java 或 Kotlin 代码动态地修改 RecyclerView 的属性:

1)设置 LayoutManager

recyclerView.setLayoutManager(new LinearLayoutManager(context));
// 或者 GridLayoutManager, StaggeredGridLayoutManager 等

2)设置 ItemAnimator

recyclerView.setItemAnimator(new DefaultItemAnimator());

3)设置适配器

recyclerView.setAdapter(adapter);

4)设置项目装饰

recyclerView.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL));

5)设置 HasFixedSize

recyclerView.setHasFixedSize(true);  // 如果所有项大小相同,可以提高性能

6)设置 NestedScrollingEnabled

recyclerView.setNestedScrollingEnabled(false);  // 默认为 true

7)设置 OnScrollListener

recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
    @Override
    public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
        super.onScrolled(recyclerView, dx, dy);
        // 处理滚动事件
    }
});

8)设置 ItemTouchHelper

ItemTouchHelper itemTouchHelper = new ItemTouchHelper(simpleCallback);
itemTouchHelper.attachToRecyclerView(recyclerView);

9)设置 OverScrollMode

recyclerView.setOverScrollMode(View.OVER_SCROLL_ALWAYS);  // 可以是 OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER

10)设置 ItemViewCacheSize

recyclerView.setItemViewCacheSize(20);  // 设置缓存的视图数量

11)设置 RecycledViewPool

RecyclerView.RecycledViewPool pool = new RecyclerView.RecycledViewPool();
recyclerView.setRecycledViewPool(pool);

12)设置 AccessibilityDelegateCompat

recyclerView.setAccessibilityDelegateCompat(new RecyclerViewAccessibilityDelegate(recyclerView));

13)设置 EdgeEffectFactory

recyclerView.setEdgeEffectFactory(new CustomEdgeEffectFactory());

14)设置 Focusable 和 FocusableInTouchMode

recyclerView.setFocusable(true);
recyclerView.setFocusableInTouchMode(true);

15)设置 DescendantFocusability

recyclerView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);

 

16.案例:Recyclerview 的简单使用

1.代码
1-xml布局代码
<?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:orientation="vertical">

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

        <ImageView
            android:id="@+id/imageView"
            android:layout_width="256dp"
            android:layout_height="256dp"
            android:src="@drawable/a_girl" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:background="#C4B9ED">

            <!-- 文章标题 -->
            <TextView
                android:id="@+id/textViewTittle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Hello World!"
                android:textSize="20dp"
                android:textStyle="bold"
                android:textColor="#C82020"
                android:gravity="center"
                android:layout_marginBottom="20dp" />

            <!-- 描述文本 -->
            <TextView
                android:id="@+id/textViewDescription"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Hello World!"
                android:textSize="13sp" />

        </LinearLayout>

    </LinearLayout>

</LinearLayout>

activity_main.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"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">

    <!-- 文章 -->
    <TextView
        android:id="@+id/tv_content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:background="#C6D9ED"
        android:gravity="center"
        android:padding="10dp"
        android:text="文章内容"
        android:textSize="16sp"
        tools:ignore="MissingConstraints" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycle_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"

       />


</LinearLayout>

2-java代码
package com.xiji.myrecycleview;

import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;


public class MainActivity extends AppCompatActivity {

    // 适配器
    MyRecycleAdapter adapter;

    // 视图
    RecyclerView recyclerView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.activity_main);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
            Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
            return insets;
        });
        initView();
    }

    private void initView() {
        recyclerView = findViewById(R.id.recycle_view);
        //设置布局管理器
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        adapter = new MyRecycleAdapter();
        //设置数据适配器
        recyclerView.setAdapter(adapter);
    }
}

3-适配器代码
package com.xiji.myrecycleview;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;


import androidx.recyclerview.widget.RecyclerView;



public class MyRecycleAdapter extends RecyclerView.Adapter<MyRecycleAdapter.MyView> {

    private String[] titles = {"一个小女孩",
            "小男孩",
            "小男孩2",
            "小女孩1",
            "小女孩2",
            "小狗",
            "蓝色小老鼠"};
    private String[] details = {"这是一个手里拿着水晶块的小女孩",
            "这是一个穿着蓝色夹克的小男孩",
            "这是一个穿着T恤衫的小男孩",
            "这是一个小女孩", "这是一个长耳朵的小女孩",
            "这是一个穿着衣服的小狗",
            "这是一只蓝色的小老鼠"};
    private int[] imagesInfos = {R.drawable.a_girl,
            R.drawable.boy_one,
            R.drawable.boy_two,
            R.drawable.girl_one,
            R.drawable.girl_two,
            R.drawable.dog_one,
            R.drawable.mouse};

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

    @Override
    public void onBindViewHolder( MyView holder, int position) {
        holder.title.setText(titles[position]);
        holder.detail.setText(details[position]);
        holder.image.setImageResource(imagesInfos[position]);
    }

    @Override
    public int getItemCount() {
        return titles.length;
    }

    class MyView extends RecyclerView.ViewHolder {
        TextView title;
        TextView detail;
        ImageView image;

        public MyView(View itemView) {
            super(itemView);
            title = itemView.findViewById(R.id.textViewTittle);
            detail = itemView.findViewById(R.id.textViewDescription);
            image = itemView.findViewById(R.id.imageView);
        }
    }
}

2.效果

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

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

相关文章

JavaScript Set 必备指南:深入理解 Set 的特性和方法

一. 了解 Set 1. 概念和用途 Set 是 JavaScript 中的一种集合&#xff08;collection&#xff09;数据结构&#xff0c;它类似于数组&#xff0c;但是集合中的元素是唯一的&#xff0c;不允许重复。Set 提供了一种存储不重复数值或对象的机制&#xff0c;可以用于存储一组唯一…

【03】手把手教你0基础部署SpringCloud微服务商城教学-Docker前置篇(附Linux虚拟机配置调试及Docker安装全流程)

前文回顾&#xff1a;【02】手把手教你0基础部署SpringCloud微服务商城教学-Mybatis篇&#xff08;下&#xff09; 首先我们第一次看见这个东西&#xff0c;第一步就是需要知道它到底是用来干什么的&#xff1f; 简单来说&#xff0c;Docker就是一个快速构建、运行、管理应用的…

K8s-services+pod详解1

一、Service 我们能够利用Deployment创建一组Pod来提供具有高可用性的服务。 虽然每个Pod都会分配一个单独的Pod IP&#xff0c;然而却存在如下两问题&#xff1a; Pod IP 会随着Pod的重建产生变化Pod IP 仅仅是集群内可见的虚拟IP&#xff0c;外部无法访问 这样对于访问这…

【干货】2024新学期期中考试,老师成绩发布工具

老师们别再为期中发成绩发愁了&#xff0c;我给各位带来了一个解决方案——易查分小程序&#xff0c;它可以将彻底改变您发布成绩的方式&#xff01;一分钟发布期中考试成绩。不管您是教育界的新手还是老手&#xff0c;易查分都能成为您的得力助手。它的界面既美观又实用&#…

大数据毕业设计选题推荐-音乐数据分析系统-音乐推荐系统-Python数据可视化-Hive-Hadoop-Spark

✨作者主页&#xff1a;IT研究室✨ 个人简介&#xff1a;曾从事计算机专业培训教学&#xff0c;擅长Java、Python、微信小程序、Golang、安卓Android等项目实战。接项目定制开发、代码讲解、答辩教学、文档编写、降重等。 ☑文末获取源码☑ 精彩专栏推荐⬇⬇⬇ Java项目 Python…

一些近期值得关注的存储和备份潜在漏洞

时刻保持警惕&#xff0c;及时、适时地检测暴露于安全建议和警告的相关设备&#xff0c;这一点对企业数据安全再重要不过了。 Continuity调研指出了最近几个月&#xff0c;存储和备份解决方案中存在的、可被攻击者发现和利用的潜在漏洞&#xff0c;包括&#xff1a; Veeam Ba…

YOLOv10改进目录一览 | 涉及卷积层、轻量化、注意力、损失函数、Backbone、SPPF、Neck、检测头等全方位改进

必读内容&#x1f4d6; 如何寻找创新点&#xff1f;为什么要使用这个模块&#xff1f;如何才能提升模型的精度&#xff1f;这是贯穿我们研究始终的问题。创新点在这个专栏中我已经整理好了&#xff0c;这已经省去了大部分时间&#xff0c;但是当我们使用这些新的模块去优化已有…

LDR6500取电诱骗协议芯片:革新电子设备充电体验

在当今电子设备日新月异的时代&#xff0c;Type-C接口以其高效、便捷的特点迅速成为市场主流。这一接口不仅支持高速数据传输&#xff0c;还实现了正反插拔的便利性&#xff0c;极大地提升了用户体验。然而&#xff0c;在Type-C接口的广泛应用背后&#xff0c;一个关键的技术组…

Java日常开发小结-01

一、fastjson2 FastJson对于json格式字符串的解析主要用到三个类1.JSON&#xff1a;解析器&#xff0c;用于JSON格式字符串与JSON对象及javaBean之间的转换 2.JSONObject&#xff1a;json对象 3.JSONArray&#xff1a; json数组对象 1.1、引入依赖 <dependency><gr…

雷池社区版本SYSlog使用教程

雷池会对恶意攻击进行拦截&#xff0c;但是日志都在雷池机器上显示 如何把日志都同步到相关设备进行统一的管理和分析呢&#xff1f; 如需将雷池攻击日志实时同步到第三方服务器, 可使用雷池的 Syslog 外发 功能 启用 Syslog 外发 进入雷池 系统设置 页面, 配置 Syslog 设置…

基于单片机的公交车自动报站器设计

本设计是以STM32单片机为控制核心的公交车自动报站系统&#xff0c;该系统的主要构成模块有&#xff1a;控制核心模块、GPS模块、温度模块、语音模块、按键控制模块和显示模块。采用点阵显示屏&#xff0c;可自动显示下一站&#xff0c;使用OLED显示器显示温度和经纬度&#xf…

免费使用Cursor, 切换DeepSeek模型

1. 选择设置 直接点击右上角的齿轮图标 或 者通过文件-->首选项-->Cursor Settings 2. 添加模型 点击Models→Add model 添加模型→添加Deepseek的模型名称&#xff1a;deepseek-coder 和 deepseek-chat→注意&#xff1a;模型名一定不能输错&#xff01;&#xff…

2024年区块链钱包现状与未来趋势分析

钱包作为Web3世界的入口&#xff0c;充当了用户与区块链应用交互、管理资金和传递信息的关键工具。随着区块链技术的发展&#xff0c;钱包生态系统日益多样化&#xff0c;涌现出大量不同类型的解决方案。这些解决方案不仅极大地改善了用户体验&#xff0c;还推动了区块链技术和…

鸿蒙HarmonyOS开发:应用权限的基本概念及如何申请应用权限详细介绍

文章目录 一、访问控制二、应用权限1、应用权限管控2、权限使用的基本原则3、授权方式4、权限等级 三、申请应用权限1、选择申请权限的方式2、声明权限3、声明样例4、二次向用户申请授权5、具体实现示例6、效果展示 四、应用权限列表1、system_grant&#xff08;系统授权&#…

基于FPGA的以太网设计(二)

一.以太网硬件架构概述 前文讲述了以太网的一些相关知识&#xff0c;本文将详细讲解以太网的硬件架构 以太网的电路架构一般由MAC、PHY、变压器、RJ45和传输介质组成&#xff0c;示意图如下所示&#xff1a; PHY&#xff1a;Physical Layer&#xff0c;即物理层。物理层定义了…

三、异步加载场景

一、加载场景实现 1、加载进度条方法 在加载场景这个预制体面板上挂在一个代码 LoadingWnd 先对组件进行声明包括&#xff08;一个进度条上的文字、提示组件&#xff08;进度条位置&#xff09;、进度点、进度百分比&#xff09; 使用进度条&#xff0c;首先要初始化一下&am…

使用Docker搭建WAF-开源Web防火墙VeryNginx

1、说明 VeryNginx 基于 lua_nginx_module(openrestry) 开发,实现了防火墙、访问统计和其他的一些功能。 集成在 Nginx 中运行,扩展了 Nginx 本身的功能,并提供了友好的 Web 交互界面。 文章目录 1、说明1.1、基本概述1.2、主要功能1.3、应用场景2、拉取镜像3、配置文件4、…

SVM及其实践2 --- 对典型数据集的多分类实践

说明 本文为SVM系列的第二篇文章&#xff0c;主要是基于SVM对两份公开数据集的分类实践。建议读者在阅读本文前先看看本系列的第一篇博文[1]: SVM及其实践1 --- 概念、理论以及二分类实践-CSDN博客 Blog 2024.10.6 本文第一次撰写 目录 说明 目录 一、Iris数据集以及基于S…

Qt-链接数据库可视化操作

1. 概述 Qt 能够支持对常见数据库的操作&#xff0c;例如&#xff1a; MySQL、Oracle、SqlServer 等等。 Qt SQL模块中的API分为三层&#xff1a;驱动层、SQL接口层、用户接口层。 驱动层为数据库和SQL接口层之间提供了底层的桥梁。 SQL接口层提供了对数据库的访问&#xff0…

【源码+文档+调试讲解】基于安卓的小餐桌管理系统springboot框架

摘 要 相比于以前的传统手工管理方式&#xff0c;智能化的管理方式可以大幅降低运营人员成本&#xff0c;实现了小餐桌的标准化、制度化、程序化的管理&#xff0c;有效地防止了小餐桌的随意管理&#xff0c;提高了信息的处理速度和精确度&#xff0c;能够及时、准确地查询和修…