【iOS】——知乎日报第五周总结

news2024/9/20 12:37:24

文章目录

  • 一、评论区展开与收缩
  • 二、FMDB库实现本地持久化
      • FMDB常用类:
      • FMDB的简单使用:
  • 三、点赞和收藏的持久化


一、评论区展开与收缩

有的评论没有被回复评论或者被回复评论过短,这时就不需要展开全文的按钮,所以首先计算被回复评论的文本高度,根据文本高度来决定是否隐藏展开全文的按钮。

CGSize constrainedSize = CGSizeMake(WIDTH - 70, CGFLOAT_MAX); // labelWidth为UILabel的宽度,高度设置为无限大
    NSDictionary *attributes = @{NSFontAttributeName: cell.replyLabel.font}; // label为要计算高度的UILabel控件
    CGRect textRect = [cell.replyLabel.text boundingRectWithSize:constrainedSize
                                         options:NSStringDrawingUsesLineFragmentOrigin
                                      attributes:attributes
                                         context:nil];
    CGFloat textHeight = CGRectGetHeight(textRect);
    if (textHeight > 100) {
        cell.foldButton.hidden = NO;
    } else {
        cell.foldButton.hidden = YES;
    }

要实现评论区的展开全文和收起,需要先实现评论区文本的自适应高度,接着我用数组来记录每个按钮的状态,如果为展开状态则为1,如果为收起状态则为0。通过数组中按钮的状态为按钮的selected属性做出选择并改变cell的高度。当我点击按钮时就改变该按钮在数组中的相应值。

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0 && self.longComments != 0) {

        NSString* longStr = [self.discussModel.longCommentsArray[indexPath.row] content];
        NSString* longReplyStr = [self.discussModel.longCommentsArray[indexPath.row] reply_to][@"content"];
        CGSize constrainedSize = CGSizeMake(WIDTH - 70, CGFLOAT_MAX); // labelWidth为UILabel的宽度,高度设置为无限大
        UIFont *font = [UIFont systemFontOfSize:18.0];
        NSDictionary *attributes = @{NSFontAttributeName: font}; // label为要计算高度的UILabel控件
        CGRect textRect = [longStr boundingRectWithSize:constrainedSize
                                             options:NSStringDrawingUsesLineFragmentOrigin
                                          attributes:attributes
                                             context:nil];
        CGFloat textHeight = CGRectGetHeight(textRect);
        
        CGSize constrainedSize02 = CGSizeMake(WIDTH - 70, CGFLOAT_MAX); // labelWidth为UILabel的宽度,高度设置为无限大
        UIFont *font02 = [UIFont systemFontOfSize:16.0];
        NSDictionary *attributes02 = @{NSFontAttributeName: font02}; // label为要计算高度的UILabel控件
        CGRect textRect02 = [longReplyStr boundingRectWithSize:constrainedSize02
                                             options:NSStringDrawingUsesLineFragmentOrigin
                                          attributes:attributes02
                                             context:nil];
        CGFloat textHeight02 = CGRectGetHeight(textRect02);
        
        NSLog(@"长评论高度为:%f", textHeight);
        if ([self.discussModel.longButtonSelectArray[indexPath.row] isEqualToString:@"1"]) {
            return textHeight + textHeight02 + 180;
        }
        return textHeight + 180;
    } else {
        NSString* shortStr = [self.discussModel.shortCommentsArray[indexPath.row] content];
        NSString* shortReplyStr = [self.discussModel.shortCommentsArray[indexPath.row] reply_to][@"content"];
        CGSize constrainedSize = CGSizeMake(WIDTH - 70, CGFLOAT_MAX); // labelWidth为UILabel的宽度,高度设置为无限大
        UIFont *font = [UIFont systemFontOfSize:18.0];
        NSDictionary *attributes = @{NSFontAttributeName: font}; // label为要计算高度的UILabel控件
        CGRect textRect = [shortStr boundingRectWithSize:constrainedSize
                                             options:NSStringDrawingUsesLineFragmentOrigin
                                          attributes:attributes
                                             context:nil];
        CGFloat textHeight = CGRectGetHeight(textRect);
        
        CGSize constrainedSize02 = CGSizeMake(WIDTH - 70, CGFLOAT_MAX); // labelWidth为UILabel的宽度,高度设置为无限大
        UIFont *font02 = [UIFont systemFontOfSize:16.0];
        NSDictionary *attributes02 = @{NSFontAttributeName: font02}; // label为要计算高度的UILabel控件
        CGRect textRect02 = [shortReplyStr boundingRectWithSize:constrainedSize02
                                             options:NSStringDrawingUsesLineFragmentOrigin
                                          attributes:attributes02
                                             context:nil];
        CGFloat textHeight02 = CGRectGetHeight(textRect02);
        
        NSLog(@"段评论高度为:%f", textHeight);
        if ([self.discussModel.shortButtonSelectArray[indexPath.row] isEqualToString:@"1"]) {
            return textHeight + textHeight02 + 180;
        }
        return textHeight + 180;
    }  
}

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0 && self.longComments != 0) {
        if (indexPath.row == 0) {
            cell.commentsNumLabel.text = [NSString stringWithFormat:@"%ld条长评", self.longComments];
        }
        cell.foldButton.tag = indexPath.row * 2 + 1;
        if ([self.discussModel.longButtonSelectArray[indexPath.row] isEqualToString:@"1"]) {
            cell.foldButton.selected = YES;
            cell.replyLabel.numberOfLines = 0;
        } else {
            cell.foldButton.selected = NO;
            cell.replyLabel.numberOfLines = 2;
        }
}else {
        
        cell.foldButton.tag = indexPath.row * 2;
        if ([self.discussModel.shortButtonSelectArray[indexPath.row] isEqualToString:@"1"]) {
            cell.foldButton.selected = YES;
            cell.replyLabel.numberOfLines = 0;
        } else {
            cell.foldButton.selected = NO;
            cell.replyLabel.numberOfLines = 2;
        }
- (void)pressFold:(UIButton*)button {
    DiscussCustomCell* cell = (DiscussCustomCell*)[[button superview] superview];
    if ([self.discussModel.longButtonSelectArray[(button.tag - 1) / 2] isEqualToString:@"1"]) {
        [self.discussModel.longButtonSelectArray replaceObjectAtIndex:((button.tag - 1) / 2) withObject:@"0"];
        [self.discussView.tableview reloadData];
    } else {
        [self.discussModel.longButtonSelectArray replaceObjectAtIndex:((button.tag - 1) / 2) withObject:@"1"];
        [self.discussView.tableview reloadData];
    }
    
    if ([self.discussModel.shortButtonSelectArray[button.tag / 2] isEqualToString:@"1"]) {
        [self.discussModel.shortButtonSelectArray replaceObjectAtIndex:(button.tag / 2) withObject:@"0"];
        [self.discussView.tableview reloadData];
    } else {
        [self.discussModel.shortButtonSelectArray replaceObjectAtIndex:(button.tag / 2) withObject:@"1"];
        [self.discussView.tableview reloadData];
    }
}

请添加图片描述

请添加图片描述

二、FMDB库实现本地持久化

FMDB是iOS平台的SQLite数据库框架,以OC的方式封装了SQLite的C语言API。

FMDB常用类:

FMDatabase:一个FMDatabase对象就代表一个单独的SQLite数据库用来执行SQL语句。
FMResultSet:使用FMDatabase执行查询后的结果集。
FMDatabaseQueue:用于在多线程中执行多个查询或更新,它是线程安全的。

FMDB的简单使用:

要使用FMDB库首先需要通过CocoaPods来安装这个第三方库

pod 'FMDB'

安装完成之后就可以进行使用了。

创建数据库

//获取数据库文件的路径
    NSString* doc = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];

        NSString *fileName = [doc stringByAppendingPathComponent:@"collectionData.sqlite"];
    //获得数据库
    self.collectionDatabase = [FMDatabase databaseWithPath:fileName];
    //打开数据库
    if ([self.collectionDatabase open]) {
        BOOL result = [self.collectionDatabase executeUpdate:@"CREATE TABLE IF NOT EXISTS collectionData (mainLabel text NOT NULL, nameLabel text NOT NULL, imageURL text NOT NULL, networkURL text NOT NULL, dateLabel text NOT NULL, nowLocation text NOT NULL, goodState text NOT NULL, collectionState text NOT NULL, id text NOT NULL);"];
        if (result) {
            NSLog(@"创表成功");
        } else {
            NSLog(@"创表失败");
        }
    }

数据库增加数据

//插入数据
- (void)insertData {
    if ([self.collectionDatabase open]) {
        NSString *string = @"GenShen";
        BOOL result = [self.collectionDatabase executeUpdate:@"INSERT INTO collectionData (mainLabel, nameLabel, imageURL, networkURL, dateLabel, nowLocation, goodState, collectionState, id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);", string, string, string, string, string, string, string, string, string];
        if (!result) {
            NSLog(@"增加数据失败");
        }else{
            NSLog(@"增加数据成功");
        }
        [self.collectionDatabase close];
    }
}

数据库修改数据

//修改数据
- (void)updateData {
    if ([self.collectionDatabase open]) {
        NSString* sql = @"UPDATE collectionData SET id = ? WHERE nameLabel = ?";
        BOOL result = [self.collectionDatabase executeUpdate:sql, @"114514",@"GenShen"];
        if (!result) {
                    NSLog(@"数据修改失败");
                } else {
                    NSLog(@"数据修改成功");
                }
                [self.collectionDatabase close];
    }
}

数据库删除数据

//删除数据
- (void)deleteData {
    if ([self.collectionDatabase open]) {
        NSString* sql = @"delete from collectionData WHERE collectionState = ?";
        BOOL result = [self.collectionDatabase executeUpdate:sql, @"爱玩原神"];
        if (!result) {
                    NSLog(@"数据删除失败");
                } else {
                    NSLog(@"数据删除成功");
                }
                [self.collectionDatabase close];
    }
}

数据库查询数据

//查询数据
- (void)queryData {
    if ([self.collectionDatabase open]) {
        FMResultSet* resultSet = [self.collectionDatabase executeQuery:@"SELECT * FROM collectionData"];
        while ([resultSet next]) {
                    NSString *mainLabel = [resultSet stringForColumn:@"mainLabel"];
                    NSLog(@"mainLabel = %@",mainLabel);
                    NSString *nameLabel = [resultSet stringForColumn:@"nameLabel"];
                    NSLog(@"nameLabel = %@",nameLabel);
                    NSString *imageURL = [resultSet stringForColumn:@"imageURL"];
                    NSLog(@"imageURL = %@",imageURL);
                    NSString *networkURL = [resultSet stringForColumn:@"networkURL"];
                    NSLog(@"networkURL = %@",networkURL);
                    NSString *dateLabel = [resultSet stringForColumn:@"dateLabel"];
                    NSLog(@"dateLabel = %@",dateLabel);
                    NSString *nowLocation = [resultSet stringForColumn:@"nowLocation"];
                    NSLog(@"nowLocation = %@",nowLocation);
                    NSString *goodState = [resultSet stringForColumn:@"goodState"];
                    NSLog(@"goodState = %@",goodState);
                    NSString *collectionState = [resultSet stringForColumn:@"collectionState"];
                    NSLog(@"collectionState = %@",collectionState);
                    NSString *id = [resultSet stringForColumn:@"id"];
                    NSLog(@"id = %@",id);
                }
                [self.collectionDatabase close];
    }
}

三、点赞和收藏的持久化

要实现点赞和收藏的持久化就需要用到前面所提到的FMDB库进行操作。在需要用到数据库的部分进行数据库的创建和一些基本操作例如增删改查。以收藏持久化为例子,当点击点赞收藏按钮的时候,进入到数据库查询函数进行查询,如果找到就将该数据进行删除然后将按钮状态设置为未选中状态。如果没有找到该数据就进行添加然后将按钮状态设置为选中状态

- (void)pressCollect:(UIButton*)button {
    
        NSString* collectionIdStr = [NSString stringWithFormat:@"%ld", self.idStr];
        int flag = [self queryCollectionData];
        if (flag == 1) {
            self.mainWebView.collectButton.selected = NO;
            [self deleteCollectionData:collectionIdStr];
        } else {
            self.mainWebView.collectButton.selected = YES;
            [self insertCollectionData:self.mainLabel andUrl:self.imageUrl andStr:collectionIdStr];
        }
}


当滑动切换页面请求新闻额外信息时也需要先进行判断当前点赞和收藏的按钮状态

[[ExtraManager sharedSingleton] ExtraGetWithData:^(GetExtraModel * _Nullable extraModel) {
        dispatch_async(dispatch_get_main_queue(), ^{
            int flag = [self queryLikesData];
            int collectFlag = [self queryCollectionData];
            self.mainWebView.discussLabel.text = [NSString stringWithFormat:@"%ld", extraModel.comments];
            self.mainWebView.likeLabel.text = [NSString stringWithFormat:@"%ld", extraModel.popularity];
            self.longComments = extraModel.long_comments;
            self.shortComments = extraModel.short_comments;
            if (flag == 1) {
                self.mainWebView.likeButton.selected = YES;
                NSInteger likesNum = [self.mainWebView.likeLabel.text integerValue];
                likesNum++;
                self.mainWebView.likeLabel.text = [NSString stringWithFormat:@"%ld", likesNum];
                NSString* likesIdStr = [NSString stringWithFormat:@"%ld", self.idStr];
                [self insertLikesData:likesIdStr];
            } else {
                self.mainWebView.likeButton.selected = NO;
            }
            if (collectFlag == 1) {
                self.mainWebView.collectButton.selected = YES;
            } else {
                self.mainWebView.collectButton.selected = NO;
            }
            
            NSLog(@"额外信息获取成功");
        });
        } andError:^(NSError * _Nullable error) {
            NSLog(@"额外信息获取失败");
        } andIdStr:self.idStr];

收藏数据库部分代码如下:

//创建
- (void)databaseInit {
    NSString* likesDoc = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
        NSLog(@"%@", likesDoc);
        NSString * likesFileName = [likesDoc stringByAppendingPathComponent:@"likesData.sqlite"];
    self.likesDatabase = [FMDatabase databaseWithPath:likesFileName];
    if ([self.likesDatabase open]) {
            BOOL result = [self.likesDatabase executeUpdate:@"CREATE TABLE IF NOT EXISTS likesData (id text NOT NULL);"];
            if (result) {
                NSLog(@"创表成功");
            } else {
                NSLog(@"创表失败");
            }
        }
    
    NSString* collectionDoc = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
        NSLog(@"%@", collectionDoc);
        NSString * collectionFileName = [collectionDoc stringByAppendingPathComponent:@"collectionData02.sqlite"];
    self.collectionDatabase = [FMDatabase databaseWithPath:collectionFileName];
    if ([self.collectionDatabase open]) {
            BOOL result  = [self.collectionDatabase executeUpdate:@"CREATE TABLE IF NOT EXISTS collectionData (mainLabel text NOT NULL, imageURL text NOT NULL, id text NOT NULL);"];
            if (result) {
                NSLog(@"创表成功");
            } else {
                NSLog(@"创表失败");
            }
        }
    
}
//增加
- (void)insertCollectionData:(NSString *)mainLabel andUrl:(NSString *)imageURL andStr:(NSString*)string {
    if ([self.collectionDatabase open]) {
        BOOL result = [self.collectionDatabase executeUpdate:@"INSERT INTO collectionData (mainLabel, imageURL, id) VALUES (?, ?, ?);", mainLabel, imageURL,string];
        if (!result) {
            NSLog(@"增加收藏数据失败");
        }else{
            NSLog(@"增加收藏数据成功");
        }
    }
    [self.collectionDatabase close];
}
//删除
- (void)deleteCollectionData:(NSString*)string {
    if ([self.collectionDatabase open]) {
        NSString *sql = @"delete from collectionData WHERE id = ?";
        BOOL result = [self.collectionDatabase executeUpdate:sql, string];
        if (!result) {
            NSLog(@"删除收藏数据失败");
        }else{
            NSLog(@"删除收藏数据成功");
        }
    }
    [self.collectionDatabase close];
}

//查询
- (int)queryCollectionData {
    if ([self.collectionDatabase open]) {
        FMResultSet* collectionResultSet = [self.collectionDatabase executeQuery:@"SELECT * FROM collectionData"];
        int count = 0;
        while ([collectionResultSet next]) {
            NSString *sqlIdStr = [NSString stringWithFormat:@"%@", [collectionResultSet objectForColumn:@"id"]];
            NSInteger sqlId = [sqlIdStr integerValue];
            NSLog(@"第 %d 个收藏数据库数据:%ld", count++ ,sqlId);
            if (self.idStr == sqlId) {
                [self.collectionDatabase close];
                return 1;
            }
           
        }
    }
    [self.collectionDatabase close];
    return 0;
}

请添加图片描述

请添加图片描述

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

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

相关文章

单图像3D重建AI算法综述【2023】

计算机视觉是人工智能的一个快速发展的领域,特别是在 3D 领域。 本概述将考虑一个应用任务:2D 和 3D 环境之间的转换。 在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编…

Flink 运行架构和核心概念

Flink 运行架构和核心概念 几个角色的作用: 客户端:提交作业JobManager进程 任务管理调度 JobMaster线程 一个job对应一个JobMaster 负责处理单个作业ResourceManager 资源的分配和管理,资源就是任务槽分发器 提交应用,为每一个…

【C++上层应用】1. 异常处理

文章目录 【 1. C的标准异常 】【 2. 异常转移处理 】2.1 throw 抛出异常2.2 try 捕获异常2.3 catch 捕获异常2.4 实例 【 3. 定义新的异常 】 异常是程序在执行期间产生的问题,比如编译报错、链接错误等。 【 1. C的标准异常 】 C 提供了一系列标准的异常&#xf…

聊一聊go的单元测试(goconvey、gomonkey、gomock)

文章目录 概要一、测试框架1.1、testing1.2、stretchr/testify1.3、smartystreets/goconvey1.4、cweill/gotests 二、打桩和mock2.1、打桩2.2、mock2.2.1、mockgen2.2.1、示例 三、基准测试和模糊测试3.1、基准测试3.2、模糊测试 四、总结4.1、小结4.2、其他4.3、参考资料 概要…

数电实验-----实现74LS153芯片扩展为8选1数据选择器以及应用(Quartus II )

目录 一、74LS153芯片介绍 管脚图 功能表 二、4选1选择器扩展为8选1选择器 1.扩展原理 2.电路图连接(Quartus II ) 3.仿真结果 三、8选1选择器的应用 1.三变量表决器 2.奇偶校验电路 一、74LS153芯片介绍 74ls153芯片是属于四选一选择器的芯片。…

Python---函数的嵌套(一个函数里面又调用了另外一个函数)

函数嵌套调用------就是一个函数里面又调用了另外一个函数。 基本语法: # 定义 函数B def funcB():print(这是funcB函数的函数体部分...)# 定义 函数A def funcA():print(- * 80) # 这一行为了更好区分print(这是funcA函数的函数体部分...)# 假设我们在调用funcA…

FPGA系列:1、FPGA/verilog源代码保护:基于Quartus13.1平台保护verilog源码发给第三方但不泄露源码

catlog 需求具体步骤工程描述去掉相关调试文件切换顶层模块并导出相应模块为网表文件切换回原顶层模块并添加相应保护模块的qxp文件再次编译工程 参考: 需求 有时需要将源码交付给第三方,但是源码中部分模块涉及到的核心代码无法暴漏给第三方。因此&…

视频转码方法:多种格式视频批量转FLV视频的技巧

随着互联网的发展,视频已成为日常生活中不可或缺的一部分。然而,不同的视频格式可能适用于不同的设备和平台,因此需要进行转码。在转码之前,要了解各种视频格式的特点和适用场景。常见的视频格式包括MP4、AVI、MKV、FLV等。其中&a…

【数据结构与算法】Kadane‘s算法(动态规划、最大子数组和)

文章目录 一、算法原理二、例题2.1 最大子数组和2.2 环形子数组的最大和 一、算法原理 Kadanes算法是一种用于解决最大子数组和问题的动态规划算法。这类问题的目标是在给定整数数组中找到一个连续的子数组,使其元素之和最大(数组含有负数)。…

采集1688整店商品(店铺所有商品、店铺列表api)

返回数据: 请求链接 {"user": [],"items": {"item": [{"num_iid": "738354436678","title": "国产正品i13 promax全网通5G安卓智能手机源头厂家批发手机","pic_url": "http…

elementui表格自定义指令控制显示哪些列可以拖动

Vue.directive(tableBorder, function (el, {value}) {// value允许传字符串数字和数组el.classList.add(z_table_hasBorder)let hasStyle el.querySelector(style)if(hasStyle){hasStyle.remove()}let style document.createElement(style)let str .z_table_hasBorder .el…

基于ResNet框架的CNN

数据准备 DATA_URL http://download.tensorflow.org/example_images/flower_photos.tgz 一、训练集和验证集的划分 #spile_data.pyimport os from shutil import copy import randomdef mkfile(file):if not os.path.exists(file):os.makedirs(file)file flower_data/flower…

代码随想录算法训练营第四十九天| 123.买卖股票的最佳时机III 188.买卖股票的最佳时机IV

文档讲解:代码随想录 视频讲解:代码随想录B站账号 状态:看了视频题解和文章解析后做出来了 123.买卖股票的最佳时机III class Solution:def maxProfit(self, prices: List[int]) -> int:if len(prices) 0:return 0dp [[0] * 5 for _ in…

【监控系统】日志可视化监控体系ELK搭建

1.ELK架构是什么 ELK是ElasticsearchLogstashKibana的简称。 Elasticsearch是一个开源的分布式搜索和分析引擎,可以用于全文检索、结构化检索和分析,它构建在Lucene搜索引擎库之上,是当前使用较为广泛的开源搜索引擎之一。 Logstash是一个…

Linux从 全栈开发 centOS 7 到 运维

Linux从 全栈开发centOS 7 到 运维 一 Linux 入门概述1.1 操作系统1.2 Linux 简介1.3 Linux 系统组成1.4 Linux 发行版1.4 Linux 应用领域1.5 Linux vs Windows 二 环境搭建【狂神说Java】服务器购买及宝塔部署环境说明为什么程序员都需要一个自己的服务器服务器如何购买买完服…

gitlab利用CI多工程持续构建

搭建CI的过程中有多个工程的时候,一个完美的构建过程往往是子工程上的更新(push 或者是merge)触发父工程的构建,这就需要如下建立一个downstream pipeline 子仓库1 .gitlab-ci.yml stages:- buildbuild_job:stage: buildtrigger:project: test_user/tes…

远程文件包含演示

远程文件包含 基本介绍 受害机器 10.9.47.181 攻击者机器1 10.9.47.41 攻击者机器2 10.9.47.217 实现过程 受害者机器开启phpstudy 并且开启允许远程连接 攻击者机器1上有一个文件,内容是phpinfo(); 攻击者机器1提供web服务使得受害者机器能够访问到攻击者…

APP源码|智慧校园电子班牌源码 智慧校园云平台

智慧校园云平台电子班牌系统包括:智慧校园信息管理平台、saas后台管理平台、微信客户端平台、智慧班牌智能终端软件。主要用于构建学校基础架构,进行成员管理、权限分配以及运营数据监管等,是“智慧校园”的“根基”,是各项应用和…

buildadmin+tp8表格操作(8) 表格下方添加 合计行

表格的下方可以自定义添加一个合计行&#xff0c;如果有其它的需求&#xff0c; 我们可以添加我们自已需要的行&#xff0c; 并不局限于合计行 以上就可以给表格的最下方添加一个合计行了 完整代码如下 <template><div class"default-main ba-table-box"&…

python 就是随便玩玩,生成gif图,生成汉字图片,超级简单

文章目录 主方法调用LetterDrawingWordDoingImage 上图 你也想玩的话&#xff0c;可以直接上码云去看 码云链接 主方法调用 import analysisdata.WordDoingImage as WordDoingImage import analysisdata.LetterDrawing as LetterDrawingif __name__ __main__:# 输入的文本&a…