展开菜单
首页 精品内容 本月促销 装机必备 Windows PDF教程 macOS软件 IOS软件 Android AI 专题
全部分类

当前位置:

首页 > 系统应用 > 官方总结鸿蒙应用开发常见问题与实现方法典型案例

官方总结鸿蒙应用开发常见问题与实现方法典型案例

1自定义Dialog的布局1.1 问题描述如何实现自定义的Dialog?1.2 实现方法添加自定义Dialog代码CommonDialog commonDialog = new CommonDialog(this);Component component = LayoutScatter.getIns

本文目录
    1自定义Dialog的布局

    1.1 问题描述

    如何实现自定义的Dialog?

    1.2 实现方法

    添加自定义Dialog代码

    CommonDialog commonDialog = new   CommonDialog(this);

    Component component = LayoutScatter.getInstance(getContext())

    .parse(ResourceTable.Layout_dialog_custom_layout, null, true);

    commonDialog.setSize(800, 500);

    commonDialog.setContentCustomComponent(component);

    commonDialog.show();

    自定义Dialog的布局文件



    ohos:width="match_parent"
    ohos:height="match_content"
    ohos:padding="10vp"
    ohos:background_element="@graphic:grey"
    ohos:orientation="vertical">

    ohos:width="match_parent"
    ohos:height="match_content"
    ohos:text="Dialog标题"
    ohos:text_color="$color:Black"
    ohos:text_style="bold"
    ohos:text_size="40fp"/>

    ohos:width="match_parent"
    ohos:height="match_parent"
    ohos:text="自定义Dialog内容"
    ohos:text_color="$color:Black"
    ohos:text_style="bold"
    ohos:weight="1"
    ohos:text_alignment="vertical_center"
    ohos:top_margin="30vp"
    ohos:bottom_margin="30vp"
    ohos:left_margin="10vp"
    ohos:right_margin="10vp"
    ohos:text_size="30fp"/>

    ohos:height="match_content"
    ohos:width="match_parent"
    ohos:orientation="horizontal">

    ohos:width="match_parent"
    ohos:text="取消"
    ohos:text_size="30fp"
    ohos:padding="10vp"
    ohos:text_color="$color:White"
    ohos:weight="1"
    ohos:margin="10vp"
    ohos:background_element="$graphic:yellow"
    ohos:height="match_content"/>

    ohos:width="match_parent"
    ohos:text="确定"
    ohos:text_size="30fp"
    ohos:weight="1"
    ohos:padding="10vp"
    ohos:text_color="$color:White"
    ohos:margin="10vp"
    ohos:background_element="$graphic:green"
    ohos:height="match_content"/>

    1.3 实际效果

    2 设置控件背景颜色

    2.1 问题描述

    在xml布局中,若设置控件的ohos:background_element="$color:yellow",是无法生效的。目前,背景颜色仅支持以$graphic方式进行设置,而不支持以$color方式设置。

    2.2 实现方法

    方式1:xml中设置控件背景颜色使用$graphic

          ohos:width="match_parent"
    ohos:text="控件按钮"
    ohos:text_size="30fp"
    ohos:padding="10vp"
    ohos:text_color="$color:White"
    ohos:background_element="$graphic:yellow"
    ohos:height="match_content"/>

    资源文件graphic中yellow.xml代码如下:


    ohos:shape="rectangle">
    ohos:color="#fff9a825"/>

    方式2:纯代码设置控件颜色

    DirectionalLayout.LayoutConfig   config = new   DirectionalLayout.LayoutConfig(DirectionalLayout.LayoutConfig.MATCH_CONTENT,   DirectionalLayout.LayoutConfig.MATCH_CONTENT);

    config.setMargins(30, 10, 10, 10);
    ShapeElement element = new ShapeElement();
    element.setRgbColor(new RgbColor(255, 111, 0));
    Text text = new Text(this);
    text.setText("xml添加背景");
    text.setTextColor(new Color(0xFFFFFFFF));
    text.setTextSize(40);
    text.setPadding(30, 20, 30, 20);
    text.setTextAlignment(TextAlignment.CENTER);
    text.setBackground(element);
    text.setLayoutConfig(config);

    2.3 实际效果

    3 ScrollView嵌套DirectionalLayout进行滚动

    3.1 问题描述

    ScrollView嵌套DirectionalLayout如何进行滚动?

    3.2 实现方法

    1. 使用xml布局,需要将ScrollView的高度设置成“match_parent”,ScrollView子布局的高度设置成“match_content”


    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:width="match_parent"
    ohos:height="match_parent"
    ohos:orientation="vertical">

    ohos:width="match_parent"
    ohos:height="match_content"
    ohos:orientation="vertical">
    ...

    1. 使用代码添加,则需要给ScrollView和子布局设置LayoutConfig
    ComponentContainer.LayoutConfig   scrollConfig = new   ComponentContainer.LayoutConfig(DirectionalLayout.LayoutConfig.MATCH_PARENT,   DirectionalLayout.LayoutConfig.MATCH_PARENT);

    scrollView.setLayoutConfig(scrollConfig);

    DirectionalLayout.LayoutConfig config = new DirectionalLayout.LayoutConfig(DirectionalLayout.LayoutConfig.MATCH_PARENT, DirectionalLayout.LayoutConfig.MATCH_CONTENT);

    myLayout.setLayoutConfig(config);

    ...

    scrollView.addComponent(myLayout);

    super.setUIContent(scrollView);

    3.3 实际效果

    4 加载和显示网络图片

    4.1 问题描述

    如何实现加载和显示网络图片?

    4.2 实现方法

    1. 在config.json中添加网络权限
    {
    "module": {
    "reqPermissions": [
    {
    "name": "ohos.permission.INTERNET"
    }
    ]
    }
    }
    1. 获取并设置网络图片
    String   urlImage = "https://www.harmonyos.com/resource/image/community/20201009-164134eSpace.jpg";

    HttpURLConnection connection = null;

    try {
    URL url = new URL(urlImage);
    URLConnection urlConnection = url.openConnection();
    if (urlConnection instanceof HttpURLConnection) {
    connection = (HttpURLConnection) urlConnection;
    }
    if (connection != null) {
    connection.connect();
    // 之后可进行url的其他操作
    // 得到服务器返回过来的流对象
    InputStream inputStream = urlConnection.getInputStream();
    ImageSource imageSource = ImageSource.create(inputStream, new ImageSource.SourceOptions());
    ImageSource.DecodingOptions decodingOptions = new ImageSource.DecodingOptions();
    decodingOptions.desiredPixelFormat = PixelFormat.ARGB_8888;
    // 普通解码叠加旋转、缩放、裁剪
    PixelMap pixelMap = imageSource.createPixelmap(decodingOptions);
    // 普通解码
    getUITaskDispatcher().syncDispatch(() -> {
    Image image = new Image(HttpImageSlice.this);
    DirectionalLayout.LayoutConfig config = new DirectionalLayout.LayoutConfig(DirectionalLayout.LayoutConfig.MATCH_CONTENT, DirectionalLayout.LayoutConfig.MATCH_CONTENT);
    config.setMargins(10, 10, 10, 10);
    image.setLayoutConfig(config);
    image.setPixelMap(pixelMap);
    myLayout.addComponent(image);
    pixelMap.release();
    });
    }

    } catch (Exception e) {
    e.printStackTrace();
    }

    4.3 实际效果

    5 ListContainer列表组件的使用

    5.1 问题描述

    ListContainer列表组件如何使用?

    5.2 实现方法

    在xml文件中声明组件


    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:width="match_parent"
    ohos:height="match_parent"
    ohos:orientation="vertical">

    ohos:id="$+id:list_container"
    ohos:orientation="vertical"
    ohos:width="match_parent"
    ohos:height="match_parent"/>

    获取 ListContainer 组件,并设置itemProvider

    private void initView() {
    mListContainer = (ListContainer) findComponentById(ResourceTable.Id_list_container);
    ListItemProvider listItemProvider = new ListItemProvider();
    mListContainer.setItemProvider(listItemProvider);
    }

    自定义 ListItemProvider 继承 RecycleItemProvider

    class ListItemProvider extends RecycleItemProvider {
    @Override
    public int getCount() {
    return data.size();
    }
    @Override
    public long getItemId(int i) {
    return 0;
    }
    @Override
    public Component getComponent(int position, Component convertView, ComponentContainer componentContainer) {
    Component component = LayoutScatter.getInstance(getContext())
    .parse(ResourceTable.Layout_layout_container_item, null, false);
    if (!(component instanceof ComponentContainer)) {
    return null;
    }
    ComponentContainer rootLayout = (ComponentContainer) component;
    Text rightText = (Text) rootLayout.findComponentById(ResourceTable.Id_content);
    rightText.setText(data.get(position));
    return component;
    }
    }

    5.3 实际效果

    6 读取资源文件

    6.1 问题描述

    如何读取应用的资源文件?

    6.2 实现方法

    1. 对于图片文件,建议放到base/media目录下,Image组件可以直接设置,方法如下。
    Image image = (Image) findComponentById(ResourceTable.Id_component_image);
    image.setPixelMap(ResourceTable.Media_huawei);
    1. 对于rawfile文件的读写,请参考下面的方法:
    ohos.global.resource.ResourceManager resourceManager = getApplicationContext().getResourceManager();
    ohos.global.resource.RawFileEntry rawFileEntry = resourceManager.getRawFileEntry("resources/rawfile/test.png");
    RawFileDescriptor rawFileDescriptor = rawFileEntry.openRawFileDescriptor();
    // 或者
    Resource resource = rawFileEntry.openRawFile();

    6.3 实际效果

    7 JS方法获取位置信息

    7.1 问题描述

    使用JS开发时,如何获取位置信息?

    7.2 实现方法

    1. 导入获取位置模块,并调用getLocation方法获取位置信息
    import geolocation from '@system.geolocation';
    export default {
    data: {
    longitude: 0.0,
    latitude: 0.0
    },
    onInit() {
    this.getLocation();
    },
    getLocation() {
    var temp = this;
    geolocation.getLocation({
    success: function(data) {
    console.info("get location success, longitude: " + data.longitude +", latitude: " + data.latitude);
    temp.longitude = data.longitude
    temp.latitude = data.latitude;
    },
    fail: function(data, code) {
    console.error("get location failed, code: " + code + ", data: " + data);
    },
    complete: function() {
    console.info("get location complete");
    }
    });
    }
    }
    1. 在config.json中增加获取位置信息的权限
    "reqPermissions": [
    {
    "name": "ohos.permission.LOCATION"
    }
    ],

    7.3 实际效果

    8 禁用手表中系统的左右滑动

    8.1 问题描述

    开发一个应用支持左右滑动的操作,但是在模拟器中右滑时,默认跳转到系统页面,并退出应用,如何禁用系统右滑?

    8.2 实现方法

    覆盖MainAbility中的onTouchEvent方法,实现如下

    @Override
    protected boolean onTouchEvent(TouchEvent event) {
    super.onTouchEvent(event);
    return true;
    }

    8.3 实际效果

    9 Text控件中文字换行

    9.1 问题描述

    Text控件中文字目前不支持n换行,如何进行换行?

    9.2 实现方法

    可以使用系统自动换行,保持两行文字长度一致,实现如下


    ohos:width="match_parent"
    ohos:height="match_parent"
    ohos:orientation="vertical">
    ohos:id="$+id:text"
    ohos:width="150vp"
    ohos:height="match_content"
    ohos:multiple_lines="true"
    ohos:max_text_lines="2"
    ohos:auto_font_size="true"
    ohos:text="目前车辆尊享服务已过期, 车主续费后才可继续使用"/>

    9.3 实际效果

    10 在一个布局xml中引入其他xml布局文件

    10.1 问题描述

    定义了一个公共的XML布局文件,如何在其他XML布局文件中引用这个公共的XML布局文件?

    10.2 实现方法

    可以通过include标签引用其他的XML布局文件,示例如下:


    ohos:layout="$layout:include_layout"
    ohos:width="match_parent"
    ohos:height="match_content"/>

    10.3 实际效果

    NA

    11 自定义Swtich控件的颜色

    11.1 问题描述

    如何自定义Swtich控件的开关两个状态下的按钮颜色?

    11.2 实现方法

    需在资源文件graphic文件下,分别创建bg_element.xml和fg_element.xml,其中bg_element.xml文件的具体内容如下



    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:shape="rectangle">

    ohos:radius="30"/>
    ohos:color="#424242"/>

    fg_element.xml文件内容如下



    xmlns:ohos="http://schemas.huawei.com/res/ohos"
    ohos:shape="oval">
    ohos:color="#D81B60"/>

    代码实现自定义颜色:

    private void setupSwitch() {

    mSwitch = (Switch) findComponentById(ResourceTable.Id_switch_custom);

    Element elementBackground = ElementScatter.getInstance(this).parse(ResourceTable.Graphic_bg_element);

    mSwitch.setTrackElement(elementBackground);

    Element elementThumb = ElementScatter.getInstance(this).parse(ResourceTable.Graphic_fg_element);

    mSwitch.setThumbElement(elementThumb);

    mSwitch.setClickedListener(new Component.ClickedListener() {

    @Override

    public void onClick(Component component) {

    Log.i("switch: " + mSwitch.isChecked());

    }

    });

    }

    11.3 实际效果

    12 视频播放

    12.1 问题描述

    如何播放本地视频文件和网络视频?

    12.2 实现方法

    创建布局文件video_player_layout.xml,内容如下



    ohos:id="$+id:video_player_dl"
    ohos:width="match_parent"
    ohos:height="match_parent"
    ohos:orientation="vertical">

    定义下面的变量,内容如下:

    private static Player mPlayer;
    private SurfaceProvider mSurfaceProvider;
    private DependentLayout mLayout;

    实现SurfaceOps.Callback接口,代码如下:

    class VideoSurfaceCallback implements SurfaceOps.Callback {
    @Override
    public void surfaceCreated(SurfaceOps surfaceOps) {
    Log.i("surfaceCreated() called.");
    if (mSurfaceProvider.getSurfaceOps().isPresent()) {
    Surface surface = mSurfaceProvider.getSurfaceOps().get().getSurface();
    playUrl(surface);
    }
    }
    @Override
    public void surfaceChanged(SurfaceOps surfaceOps, int i, int i1, int i2) {
    Log.i("surfaceChanged() called.");
    }
    @Override
    public void surfaceDestroyed(SurfaceOps surfaceOps) {
    Log.i("surfaceDestroyed() called.");
    }
    }

    实现Player.IplayerCallback接口,代码如下:

    private class VideoPlayerCallback implements Player.IPlayerCallback {
    @Override
    public void onPrepared() {
    Log.i("onPrepared");
    }
    @Override
    public void onMessage(int i, int i1) {
    Log.i("onMessage");
    }
    @Override
    public void onError(int i, int i1) {
    Log.i("onError: i=" + i + ", i1=" + i1);
    }
    @Override
    public void onResolutionChanged(int i, int i1) {
    Log.i("onResolutionChanged");
    }
    @Override
    public void onPlayBackComplete() {
    Log.i("onPlayBackComplete");
    if (mPlayer != null) {
    mPlayer.stop();
    mPlayer = null;
    }
    }
    @Override
    public void onRewindToComplete() {
    Log.i("onRewindToComplete");
    }
    @Override
    public void onBufferingChange(int i) {
    Log.i("onBufferingChange");
    }
    @Override
    public void onNewTimedMetaData(Player.MediaTimedMetaData mediaTimedMetaData) {
    Log.i("onNewTimedMetaData");
    }
    @Override
    public void onMediaTimeIncontinuity(Player.MediaTimeInfo mediaTimeInfo) {
    Log.i("onMediaTimeIncontinuity");
    }
    }

    实现播放本地文件的方法,其中test.mp4文件放到资源文件目录下,内容如下:

    private void playLocalFile(Surface surface) {
    try {
    RawFileDescriptor filDescriptor = getResourceManager().getRawFileEntry("resources/rawfile/test.mp4").openRawFileDescriptor();
    Source source = new Source(filDescriptor.getFileDescriptor(),filDescriptor.getStartPosition(),filDescriptor.getFileSize());
    mPlayer.setSource(source);
    mPlayer.setVideoSurface(surface);
    mPlayer.setPlayerCallback(new VideoPlayerCallback());
    mPlayer.prepare();
    mSurfaceProvider.setTop(0);
    mPlayer.play();
    } catch (Exception e) {
    Log.e("playUrl Exception:" + e.getMessage());
    }
    }

    实现播放网络URL的方法,其中video url为视频资源URL,内容如下:

    private void playUrl(Surface surface) {

    try {
    Source source = new Source("video url");
    mPlayer.setSource(source);
    mPlayer.setVideoSurface(surface);
    mPlayer.setPlayerCallback(new VideoPlayerCallback());
    mPlayer.prepare();
    mSurfaceProvider.setTop(0);
    mPlayer.play();
    } catch (Exception e) {
    Log.e("playUrl Exception:" + e.getMessage());
    }
    }

    播放网络视频,需要申请网络使用权限,在config.json中增加如下内容:

    "reqPermissions": [
    {
    "name": "ohos.permission.INTERNET"
    },
    ]

    12.3 实际效果

    本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系bd@zhengruan.com
    作者最新文章
    系统应用
    相关文章 更多
    精品专题 更多
    装机必备

    正软商城装机必备专区,精选办公、浏览器、安全防护、影音播放、压缩解压、设计创作和系统工具等电脑常用正版软件,帮助用户快速完成新电脑软件配置。

    Windows

    正软商城Windows软件专区,汇集适用于Windows电脑的办公、设计、安全防护、影音播放、开发工具和系统优化软件,提供软件介绍、系统要求、正版授权及购买下载服务。

    PDF教程

    正软商城PDF教程频道提供PDF编辑、转换、合并、拆分、压缩及格式处理方法,同时介绍常用PDF软件和工具的使用技巧。

    macOS软件

    正软商城macOS软件专区,精选适用于Mac电脑的办公、设计、影音、效率、开发和系统工具,提供软件功能介绍、macOS兼容版本、正版授权及购买下载服务。

    IOS软件

    正软商城iOS软件专区,精选适用于iPhone和iPad的办公、学习、影音、设计、效率及AI应用,提供功能介绍、适用设备、系统要求和正版获取方式等信息。

    AI

    正软商城AI软件专区,汇集AI写作、AI绘画、AI视频、AI办公、AI编程、AI翻译、智能客服和数据分析等人工智能工具,提供功能介绍、适用平台、收费方式及正版购买信息。

    Mac软件 更多
    Flameshot
    Flameshot

    Flameshot 将截图选区、箭头、文字、编号和模糊处理集中在截图界面。介绍安装、快捷键、保存复制与命令行入口,适合教程和问题反馈配图。

    balenaEtcher
    balenaEtcher

    balenaEtcher 用于把系统镜像写入 SD 卡或 U 盘,提供目标选择、刷写与校验流程。了解安装方法、写盘步骤、目标数据处理及镜像适用范围。

    FileZilla
    FileZilla

    FileZilla 是跨平台文件传输客户端,支持 FTP、FTPS 和 SFTP。了解站点管理、上传下载、队列、目录比较及服务器连接方法,区分免费 Client 与 Pro、Server。

    Syncthing
    Syncthing

    Syncthing 是免费开源的设备间文件同步工具,支持 Windows、macOS、Linux。了解设备 ID 配对、文件夹共享、本地管理界面、同步与备份的区别,以及部署和日常使用方法。

    FreeFileSync
    FreeFileSync

    FreeFileSync 用于比较文件夹并同步差异,支持双向、镜像等模式。了解比较方法、删除行为、SFTP 连接、首次同步流程,以及个人使用和商业使用的授权区别。

    HeidiSQL
    HeidiSQL

    HeidiSQL 提供数据库连接管理、SQL 编辑、表格浏览与 SQL 导出。本文说明支持的数据库、会话配置、查询和数据维护方法,以及 Windows、Linux、macOS 发行版本的选择。

    DBeaver
    DBeaver

    DBeaver 是支持多种数据库的桌面管理工具。了解 Community 版的数据库连接、SQL 编辑、数据表修改、导出与关系图功能,以及 Windows、macOS、Linux 的安装方式和 PRO 版差别。

    Snipaste
    Snipaste

    Snipaste 将截图、标注与桌面贴图结合,可缩放、调整透明度并管理参考图片。本文介绍快捷键、安装与贴图流程,并区分个人免费使用和 2.0 及以后版本的商用授权。

    Thunderbird
    Thunderbird

    Thunderbird 是开源桌面邮件客户端,可接入已有邮箱并管理邮件、联系人和日历。了解 IMAP 与 POP 选择、多账户统一收件箱、初次设置和本地配置备份。

    darktable
    darktable

    darktable 是开源摄影后期软件,提供 RAW 处理、照片管理、蒙版和导出功能。页面介绍光台筛选、暗房调整、安装使用,以及原片、编辑记录与导出照片的保存区别。

    Kdenlive
    Kdenlive

    Kdenlive 是免费开源视频编辑器,提供多轨时间线、代理剪辑、效果、调色及音频处理。适合需要本地剪辑的创作者,本文说明安装、项目素材管理及工程文件与成片的区别。

    PeaZip
    PeaZip

    PeaZip 是开源压缩与文件管理工具,可创建 ZIP、7z 等归档并解压多种格式,提供加密、分卷及校验功能。了解 Windows、Linux、macOS 版本选择和 RAR 解压与创建的区别。

    WINDOWS 更多
    Krokiet
    Krokiet

    Krokiet 使用 Czkawka 核心扫描重复文件、相似图片及其他待整理内容,提供包含目录、排除目录、分组结果和预览。Windows 预编译版支持 Windows 10/11,相似视频扫描另需 FFmpeg。

    QuickLook
    QuickLook

    QuickLook 让 Windows 用户选中文件后按空格快速预览图片、文档及其他支持格式,并可通过插件扩展。适合整理资料和挑选文件,具体格式支持取决于内置预览器及已安装插件。

    Bulk Crap Uninstaller
    Bulk Crap Uninstaller

    Bulk Crap Uninstaller 可集中查看 Windows 软件、执行批量卸载,并扫描卸载后的文件和注册表残留。适合整理大量安装程序,支持安装及便携使用;静默卸载能力取决于原程序卸载器。

    Ditto
    Ditto

    Ditto 为 Windows 保存文字、图片及其他格式的剪贴板历史,并提供搜索、分组和快速粘贴。基础使用无需账户,适合重复录入和资料整理;用户应管理可能包含个人信息的本地历史。

    CopyQ
    CopyQ

    CopyQ 可保存和搜索剪贴板历史,支持文字、图片、标签页以及条目编辑和命令扩展。Windows 用户可从官方项目下载,在托盘中管理历史并复制或粘贴选中条目;含敏感内容的历史需要自行管理。

    LosslessCut
    LosslessCut

    LosslessCut 可通过流复制快速剪切音视频、导出多个片段并选择保留的音轨与字幕轨。适合整理长录像及录屏;无重编码剪切受关键帧和封装格式影响,不能保证每次都在任意画面精确切断。

    Shotcut
    Shotcut

    Shotcut 为 Windows 提供多轨时间线、音视频滤镜、关键帧及编码导出功能,适合录屏整理和日常视频制作。官方下载区区分 Intel/AMD 与 ARM 安装包,Windows 主线版本要求 Windows 10 或 11。

    Upscayl
    Upscayl

    Upscayl 桌面版可在本地使用 AI 模型放大图片,提供模型选择、输出目录及批量处理。Windows 用户需要支持 Vulkan 的兼容显卡;桌面开源版与独立的云端服务采用不同的使用方式。

    Flow Launcher
    Flow Launcher

    Flow Launcher 通过键盘搜索启动 Windows 应用、查找本地文件并调用计算和插件功能。适合经常在程序与资料间切换的用户,官方提供安装版及便携版,当前主线版本要求 Windows 10 或以上。

    WorkBuddy
    WorkBuddy

    WorkBuddy 是腾讯推出的 AI 办公工作台,支持用自然语言创建任务,处理本地文件并生成文档、表格和演示文稿。本页介绍 Windows 版官网下载、系统要求、安装登录、任务提交、产物查看及免费与订阅区别。

    Joplin
    Joplin

    Joplin Windows 版适合整理个人笔记、学习资料和文件附件,支持 Markdown、富文本与离线编辑。可选择 OneDrive、WebDAV 等同步服务,并用 JEX 单独备份;Joplin Cloud 为可选付费服务。

    Process Explorer
    Process Explorer

    Process Explorer 是 Microsoft Sysinternals 的进程分析工具。了解进程树、所属账号、线程 CPU、文件句柄和 DLL 查看方法,以及便携运行与符号配置。