【Android】原来Toolbar还能这么用?Toolbar使用最全解析。网友:终于不用老是自定义标题栏啦

2023-05-16

一个Toolbar的UI可以做成什么样?做出什么效果?这是我最近在研究的问题。

目录

  • 带导航图标的Toolbar
  • 带标题的Toolbar
  • 带小标题的Toolbar
  • 带Logo的Toolbar
  • 带进度条的Toolbar
  • 带菜单的Toolbar
  • 两个菜单的Toolbar
  • 标题居中的Toolbar
  • 带搜索框的Toolbar
  • 带导航栏的Toolbar
  • 带侧滑菜单栏的Toolbar
  • 滚动页面隐藏Toolbar(一)
  • 滚动页面隐藏Toolbar(二)

除带导航栏的Toolbar、带侧滑菜单栏的Toolbar、滚动页面隐藏Toolbar外,用的都是该xml布局:

<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:layout_width="match_parent"
    android:layout_height="match_parent">

    <!--  必须用androidx.appcompat.widget.Toolbar,而不是用ToolBar,用ToolBar有些问题无解  -->
    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        android:background="@color/purple_700"/>

</androidx.constraintlayout.widget.ConstraintLayout>

带导航图标的Toolbar

相关方法描述
setNavigationIcon(Drawable icon)设置导航图标
setNavigationOnClickListener(OnClickListener listener)设置点击导航按钮监听

实现效果:

在这里插入图片描述

带标题的Toolbar

相关方法描述
setTitle(String title)设置标题
setTitleTextColor(int color)设置标题文字颜色
setTitleMarginEnd(int margin)以px为单位设置标题结束边距
setTitleMarginStart(int margin)以px为单位设置标题起始边距
setTitleMarginTop(int margin)以px为单位设置标题头部边距
setTitleMarginBottom(int margin)以px为单位设置标题底部边距
setTitleMargin(int start, int top, int end, int bottom)以px为单位设置标题边距
setTitleTextAppearance(Context context, int resId)设置指定TextAppearance资源的文本颜色、大小、样式、提示颜色和突出显示颜色
getTitleMarginEnd()获得以px为单位标题的结束边距
getTitleMarginStart()获得以px为单位标题的起始边距
getTitleMarginTop()获得以px为单位的标题的顶部边距
getTitleMarginBottom()获得以px为单位标题的底部边距

实现效果:

在这里插入图片描述

带小标题的Toolbar

相关方法描述
setSubtitle(CharSequence subtitle)设置副标题文本
setSubTitleTextColor(int color)设置副标题文本颜色
setSubTitleTextAppearance(Context context, int resId)设置指定TextAppearance资源的文本颜色、大小、样式、提示颜色和突出显示颜色
getSubtitle()获得副标题文本

实现效果:

在这里插入图片描述

带Logo的Toolbar

相关方法描述
setLogo(int resId)设置Logo图标
setLogoDescription(CharSequence description)设置工具栏标志的描述
getLogoDescription()获得工具栏标志的描述
getLogo()返回一个Drawable类型的Logo

实现效果:
在这里插入图片描述

带进度条的Toolbar

相关方法描述
setTitle(String title)设置标题
setTitleTextColor(int color)设置标题文字颜色
setNavigationIcon(Drawable icon)设置导航图标
setProgress(int progress)设置进度条当前进度
<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:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        android:background="@color/purple_700"/>

    <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="5dp"
        app:layout_constraintTop_toBottomOf="@id/toolbar"
        app:layout_constraintLeft_toLeftOf="@id/toolbar"
        app:layout_constraintRight_toRightOf="parent"/>


</androidx.constraintlayout.widget.ConstraintLayout>

实现效果:
在这里插入图片描述

带菜单的Toolbar

相关方法描述
setPopupTheme(int resId)设置菜单弹出时使用的主题
setOverflowIcon(Drawable icon)设置溢出按钮的图标 ,默认是3个小黑点
inflateMenu(int resId)将菜单资源扩充到此工具栏中
setOnMenuItemClickListener(OnMenuItemClickListener listener)点击菜单的监听事件
setMenuCallbacks(MenuPresenter.Callback pcb, MenuBuilder.Callback mcb)设置菜单回调,必须在访问菜单之前调用
getPopupTheme()获取弹出菜单的主题的资源标识符
getOverflowIcon()获取Drawable类型的溢出菜单图标

在Toolbar上建一个菜单,那就得建一个menu的文件夹与xml文件

鼠标右击res文件夹→NewAndroid Resource Directory

在这里插入图片描述
在弹出的窗口,Resource type选择menu即可

在这里插入图片描述
点击OK后会在res文件夹下生成一个menu文件夹,在这里新建一个xml文件,粘贴一下内容

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/share"
        android:title="分享"/>
    <item
        android:id="@+id/save"
        android:title="保存"/>
</menu>

紧接着Toolbar调用inflateMenu方法绑定创建的xml布局即可实现,只是这个时候还没有对这个菜单做个性化,它是默认的3点黑色圆点的效果,使用setOverflowIcon(Drawable icon)方法对其设置图标后,就成了下面的样子。

在这里插入图片描述

点击三个小圆点效果:

在这里插入图片描述

两个菜单的Toolbar

设置一个Toolbar有多个菜单,不需要修改Java代码,只要在menu文件的对应item下添加app:showAsAction="always"即可,showAsAction有五个参数,分别是:

相关方法描述
never从不在导航栏上显示,一直放在一处菜单列表里面
always总是在导航栏上显示菜单图标
ifRoom如果导航栏右侧有空间,该项就直接显示在导航栏上,不再放入溢出菜单
withText如果能在导航栏上显示,除了显示图标,还要显示该项的文字说明
collapseActionView操作视图要折叠为一个按钮,点击该按钮再展开操作视图,主要用于SearchView

实现效果:
在这里插入图片描述

标题居中的Toolbar

标题居中这一样式实现并不是用ToolbarsetTitleGravity方法,当然也没这样的方法给你。实现标题居中,主要还是得靠Toolbar里的子组件:

<TextView
    android:id="@+id/text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="标题"
    android:textSize="16sp"
    android:textColor="@color/white"
    android:layout_gravity="center"
    android:visibility="invisible"/>

Toolbar里加上TextView,我们提前在布局上将TextView居中于父组件之中,需要将标题居中的时候调用setVisibility方法,放置View.VISIBLE参数即可将标题居中的样式展示出来。

实现效果:

在这里插入图片描述
值得注意的是,在设置各种各样的Toolbar子组件时,切互将子组件的宽度设置为match_parent,子组件的宽度过大,会使Toolbar的一些样式被子组件所覆盖。

带搜索框的Toolbar

带搜索框的Toolbar,使用的是SearchView实现。实现的这一效果,特别需要注意,一定要加上setSupportActionBar(Toolbar toolbar)且将它放在Toolbar初始化后的一行。

接着,重写onCreateOptionsMenu(Menu menu)方法,使用Menu的打气筒绑定一个menu,写一个initSearchView(menu: Menu)方法设置SearchView的一些样式

override fun onCreateOptionsMenu(menu: Menu?): Boolean {
   menuInflater.inflate(R.menu.menu_toolbar3,menu)
   initSearchView(menu!!)
   return super.onCreateOptionsMenu(menu)
}

fun initSearchView(menu: Menu){
   val item = menu.findItem(R.id.search)
   // 获取搜索框对象
   val searchView = item.actionView as SearchView
   searchView.isIconified = true
   // actionView.setIconifiedByDefault(getIntent().getBooleanExtra("collapse",true));
   // 设置是否显示搜索按钮
   searchView.isSubmitButtonEnabled = true
   // 从系统服务获取搜索的管理器
   val systemService = getSystemService(SEARCH_SERVICE) as SearchManager
   // 创建搜索结果页面的组件名称对象
   val componentName = ComponentName(this, BackButtonActivity::class.java)
   // 从结果页面注册的activity结点获取相关搜索信息,即searchable.xml定义的搜索控件
   val searchableInfo = systemService.getSearchableInfo(componentName)
   // 设置搜索框的可搜索信息
   searchView.setSearchableInfo(searchableInfo)
   // 从搜索框中获取名叫search_src_text的自动完成编辑框
   val search_text: SearchAutoComplete = searchView.findViewById(R.id.search_src_text)
   // 设置文本颜色
   search_text.setTextColor(Color.BLACK)
   // 设置自动完成编辑框的提示文本颜色
   search_text.setHintTextColor(Color.BLACK)
   // 设置文本类型
   searchView.inputType = InputType.TYPE_CLASS_TEXT
   // 设置搜索提示文本
   searchView.queryHint = "请输入搜索内容"
   // 为搜索框设置文本变化监听
   searchView.setOnQueryTextListener(object : SearchView.OnQueryTextListener {
       override fun onQueryTextSubmit(query: String): Boolean {
           // 搜索关键词完成输入
           Toast.makeText(this@BackButtonActivity, "最终输入结果:$query", Toast.LENGTH_SHORT).show()
           return false
       }

       override fun onQueryTextChange(newText: String): Boolean {
           // 搜索关键词发生变化
           Toast.makeText(this@BackButtonActivity, "关键词发生改变:$newText", Toast.LENGTH_SHORT).show()
           return false
       }
   })
}

哦,对了,这玩意还得在AndroidManifest.xmlapplication节点下加点代码

<activity android:name="使用SearchView的Activity">
    <intent-filter>
        <action android:name="android.intent.action.SEARCH" />
    </intent-filter>

    <meta-data
        android:name="android.app.searchable"
        android:resource="@xml/searchable" />
</activity>

实现效果:

在这里插入图片描述
点击搜索按钮效果:

在这里插入图片描述
由于SearchView的控件是privateprotected属性,并不能调用相关的取消、确定图标组件,理论上说是无法修改这些icon,使得能修改的样式极其有限,使用范围也大大缩减。

带导航栏的Toolbar

带导航栏的Toolbar效果与Toolbar标题居中同理,皆是在Toolbar组件里面加一个子组件,只是这个子组件加的是TabLayout,这个时候还没能实现TabLayout居中的效果,TabLayout的文本默认是靠左的,需要再嵌套一个布局,将TabLayout放在布局里面,用上android:gravity="center"就可以居中了。

xml代码:

<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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".custon.Custon1Activity">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/purple_700">

        <LinearLayout
            android:id="@+id/linear"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center">

            <com.google.android.material.tabs.TabLayout
                android:id="@+id/tabLayout"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"/>

        </LinearLayout>

    </androidx.appcompat.widget.Toolbar>

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

</LinearLayout>

实现效果:

在这里插入图片描述

带侧滑菜单栏的Toolbar

第一次做侧滑菜单,参考了几年前的一个例子,用的是动画+监听屏幕滑动+屏幕滑动后的各种操作。那个例子给我的体验就是,真TM复杂,效果还差的离谱,不优化完全用不了呀!

直到DrawerLayout的出现,问题也随之迎刃而解~

带侧滑菜单栏需要以androidx.drawerlayout.widget.DrawerLayout为根布局,DrawerLayout官网给的解释是实现一个材质设计抽屉小部件。
在以DrawerLayout为根Layoutxml文件可以编写两个界面,分别是Toolbar界面与侧滑菜单界面,要想展示侧滑菜单,必须在侧滑界面的第一层加上android:layout_gravity="left"以表示从左边出现。

随后监听Toolbar的点击事件,当用户点击时执行drawer.openDrawer(GravityCompat.START)展示侧滑菜单。

<androidx.drawerlayout.widget.DrawerLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".custon.Custon2Activity"
    android:id="@+id/drawer">

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


        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"/>

    </LinearLayout>

    <!--  layout_gravity必须设置,值标识侧滑的方向  -->
    <LinearLayout
        android:layout_width="300dp"
        android:layout_height="match_parent"
        android:layout_gravity="left"
        android:orientation="vertical"
        android:background="@android:color/white">

        <TextView
            android:id="@+id/text"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center"
            android:text="侧滑菜单"/>

    </LinearLayout>

</androidx.drawerlayout.widget.DrawerLayout>

实现效果:

在这里插入图片描述

滚动页面隐藏Toolbar(一)

CoordinatorLayout定位顶级应用程序小部件,如AppBarLayoutFloatingActionButton

布局代码就贴出来了,想说也不懂说啥,全是xml代码,(⊙︿⊙)

<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:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".custon.Custon3Activity">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" >

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_scrollFlags="scroll|enterAlways"
                app:contentInsetStart="0dp"/>

        </com.google.android.material.appbar.AppBarLayout>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

</androidx.constraintlayout.widget.ConstraintLayout>

实现效果:

在这里插入图片描述
本文代码:Toolbar使用解析

滚动页面隐藏Toolbar(二)

使用的组件:
AppBarLayout:实现了材料设计应用栏概念的许多功能,即滚动手势。
CoordinatorLayout:实现折叠应用栏的包装器。
NestedScrollView:支持在新旧版本的 Android 上同时充当嵌套滚动父项和子项。默认情况下启用嵌套滚动。

<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="180dp"
        android:fitsSystemWindows="true"
        android:theme="@style/AppBarOverlay">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:toolbarId="@+id/toolbar"
            android:background="@drawable/a">

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/PopupOverlay" />

        </com.google.android.material.appbar.CollapsingToolbarLayout>
    </com.google.android.material.appbar.AppBarLayout>
	<!-- 滚动文本 -->
    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:context=".ScrollingActivity">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="16dp"
            android:text="@string/large_text" />

    </androidx.core.widget.NestedScrollView>


</androidx.coordinatorlayout.widget.CoordinatorLayout>

实现效果:
在这里插入图片描述


参考文献:
1、简书文章:Toolbar的使用
2、《Android Studio 开发实战 从零基础到APP上线》第二版第7章组合控件
3、《第一行代码》第3版第12章—最佳的UI体验,Material Design实战

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【Android】原来Toolbar还能这么用?Toolbar使用最全解析。网友:终于不用老是自定义标题栏啦 的相关文章

  • Linux Shell脚本参数传递与条件判断的方法

    参考链接 xff1a https www runoob com linux linux shell html 参数传递 Shell脚本中参数用 来表示 xff0c 如 1 第一个参数 2 第二个参数 xff0c 以此类推 xff0c 比如t
  • Linux下C检测按键按下并即时反馈的方法(不需要回车)

    在Linux下检查按键按下并即时反馈的方法 xff0c 如下 include lt stdio h gt include lt termio h gt int main termios tms old tms new tcgetattr 0
  • Linux下C语言检测多个按键按下状态的方法

    在需要同时监听多个按键按下状态的情况下 xff0c 可以通过监听 dev input event事件的方法来判断按键的状态 比如对于通过键盘控制小车时 xff0c 有可能多个方向键同时按下 xff0c 需要同时监测到 xff0c 通过前面文
  • Ubuntu ROS常用包安装

    参考链接 xff1a https www it610 com article 1290751077485977600 htm 在Ubuntu下进行ROS相关研究 xff08 比如SLAM等 xff09 xff0c 有一些常用的包需要安装 x
  • Linux下用户退出仍运行程序的方法

    在设置服务器上的应用程序时 xff0c 需要退出用户登录时仍然运行提供服务 xff0c 通过如下的命令 nohup cmd amp nohup表示不挂断程序运行 xff0c amp 表示后台运行 xff0c cmd表示需要运行的指令 xff
  • Linux下开启/关闭无线网络的方法

    参考链接 xff1a https www cnblogs com ztguang p 12648367 html 通过iwconfig命令查询和开启 关闭无线网络 iwconfig 列出启用的无线网络 sudo iwconfig lt 网络
  • 【Uni-App】出现Cannot read property ’apply’ of undefined错误

    错误日志如下 xff1a span class token number 14 span span class token punctuation span span class token number 47 span span clas
  • 通过SSH协议在本地和服务器之间传输文件和目录的方法

    参考链接 xff1a https blog csdn net w8827130 article details 90574699 通过SSH协议在本地和服务器之间传输文件 目录 xff0c 从一个地址拷贝至另一个地址 xff0c 如下 sc
  • Ubuntu强制修改用户口令的方法

    在忘记用户密码或者想要强制修改密码的时候 xff0c 可以采用启动至recovery mode的方式进行修改 在Ubuntu启动选项中 xff0c 选择Ubuntu advanced option xff0c 之后选择recovery mo
  • mqtt服务搭建及通过python进行消息交互

    参考链接 xff1a https www runoob com w3cnote mqtt intro html 对于需要与远程服务器进行数据交互的应用场景 xff0c mqtt是一种非常简便实用的数据交互机制 xff0c 通过消息的发布 订
  • RTMP服务器搭建

    参考链接 xff1a https www cnblogs com lidabo p 6404513 html 在Ubuntu 18 04上搭建一个RTMP服务器实现视频流的转播 xff0c 可以用以实现远程的监控 xff0c 通过nginx
  • CentOS下后台运行程序的方法

    参考链接 xff1a https www cnblogs com loveLands articles 10809333 html 方法一 xff1a amp 在运行命令后面加上 amp xff0c 程序就会放到后台执行 xff0c 不会占
  • 人工智能知名数据集

    网上有很多可以用于深度学习算法验证的数据集 xff0c 这里仅列出个人进行人工智能学习和研究工作涉及到的常用数据集 xff0c 比较适合初学者和刚开始从事人工智能方向研究的工作者 1 MNIST MNIST 数据集来自美国国家标准与技术研究
  • 几种查找人工智能数据集的方法

    数据集是人工智能算法训练和测试的基础 xff0c 不同专业的人工智能算法研究需要用到不同专业的数据集 xff0c 如下为网上推荐的几种寻找数据集的方法 1 Kaggle数据集 数据集地址 xff1a https www kaggle com
  • Jetson Nano开发套件安装

    参考链接 xff1a https developer nvidia com embedded learn get started jetson nano devkit intro 新到一个Jetson Nano的开发板 xff0c 用以测试
  • Window环境运行Tensorflow目标识别示例程序

    Tensorflow提供了目标识别的API来支持通过各种深度学习网络实现目标识别的功能 通过访问Github项目https github com tensorflow models 可以看到Tensorflow目前支持的各种神经网络的模型实
  • Windows下查看显卡型号及所支持的CUDA版本

    参考链接 xff1a https blog csdn net weixin 55775980 article details 116074359 通常针对NVIDIA显卡 xff0c 已安装驱动情况下 xff0c 使用nvidia smi命
  • 【IDEA】idea写java代码运行按钮是灰色的解决办法

    问题描述 Run按钮灰色状态 xff0c 无法点击运行 xff0c 如图 xff1a 原因分析 上图估计大佬一看就看出问题了 xff0c 其实就是因为少了一个main函数 问题解决 我现在把main函数补上去 span class toke
  • Linux系统查看已安装的CUDA和cuDNN版本信息

    在Linux系统下 xff0c 除了可以用nvidia smi命令查看显卡类型以及对应的CUDA版本外 xff0c 可以通过查看安装目录中的文件获得CUDA和cuDNN的安装版本信息 CUDA通常安装与 usr local cuda目录 x
  • Linux常用软件包安装工具及配置方法(apt-get, pip, dpkg)

    通常Linux需要安装 卸载软件包或模块 xff0c 这里以Ubuntu系统为例 xff0c 其它Linux系统相同或者有对应类似的命令 1 apt 用于安装软件包 xff0c 如 sudo apt install cutecom 安装cu

随机推荐