【iOS】UI学习——导航控制器、分栏控制器

UI学习(三)

  • 导航控制器
    • 导航控制器基础
    • 导航控制器切换
    • 导航栏和工具栏
  • 分栏控制器
    • 分栏控制器基础
    • 分栏控制器高级

导航控制器

在这里插入图片描述
导航控制器负责控制导航栏(navigationBar),导航栏上的按钮叫UINavigationItem(导航元素项)。它还控制着一个视图控制器,即导航栏下面的东西。

导航控制器基础

#import "SceneDelegate.h"
#import "VCRoot.h"@interface SceneDelegate ()@end@implementation SceneDelegate- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {//创建一个根视图控制器VCRoot* root = [[VCRoot alloc] init];//创建导航控制器//导航控制器主要用来管理多个视图控制器的切换//层级的方式来管理多个视图控制器//创建控制器时,一定要有一个根视图控制器//P1:就是作为导航控制器的根视图控制器UINavigationController* rev = [[UINavigationController alloc] initWithRootViewController:root];//将window的根视图设置为导航控制器self.window.rootViewController = rev;[self.window makeKeyAndVisible];
}

新建一个VCRoot类

#import "VCRoot.h"@interface VCRoot ()@end@implementation VCRoot- (void)viewDidLoad {[super viewDidLoad];//设置导航栏的透明度//默认透明度为YES:可透明的self.navigationController.navigationBar.translucent = NO;self.view.backgroundColor = [UIColor greenColor];//设置导航栏的标题文字self.title = @"娃哈哈";//设置导航元素项目的标题//如果没有设置元素项目的标题,系统会使用self.title作为标题;反之,优先为navigationItem.titleself.navigationItem.title = @"娃哈哈1";//向左侧按钮中添加文字,这里是根据title文字来创建//P1:栏按钮项的标题//P2:按钮的样式//P3:接受动作的目标对象UIBarButtonItem* leftBtn = [[UIBarButtonItem alloc] initWithTitle:@"旺仔牛奶" style:UIBarButtonItemStyleDone target:self action:@selector(pressLeft)];self.navigationItem.leftBarButtonItem = leftBtn;//右侧按钮中的文字是不可变的//这里按钮是制定了系统提供的风格样式//P1:按钮中展现的东西,注意,这里无论按钮中展现的是什么内容(无论图案或者文字),都是不可改变的UIBarButtonItem* rightBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(pressRight)];//向右侧添加自定义按钮UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 50, 40)];label.text = @"矿泉水";//将文字调至中间位置label.textAlignment = NSTextAlignmentCenter;label.textColor = [UIColor blackColor];//UIView的子类都可以被添加UIBarButtonItem* item = [[UIBarButtonItem alloc] initWithCustomView:label];//数组展现顺序从右至左NSArray* array = [NSArray arrayWithObjects:item, rightBtn, nil];//将右侧按钮数组赋值self.navigationItem.rightBarButtonItems = array;//self.navigationItem.rightBarButtonItem = rightBtn;
}-(void) pressLeft
{NSLog(@"按下了左侧按钮");
}-(void) pressRight
{NSLog(@"按下了右侧按钮");
}

效果图
在这里插入图片描述

导航控制器切换

navigationBar:导航栏对象
navigationItem:导航元素项对象
translucent:导航栏透明度
pushViewController:推入视图控制器
popViewController:推出视图控制器

首先创建三个视图
根视图VCRoot.m

#import "VCRoot.h"
#import "VCTwo.h"
@interface VCRoot ()@end@implementation VCRoot- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.self.view.backgroundColor = [UIColor greenColor];//设置导航栏的透明度,默认为YES:可透明的;NO:不可透明的self.navigationController.navigationBar.translucent = NO;self.title = @"哦哦哦";//设置导航栏的风格颜色,默认为Defaultself.navigationController.navigationBar.barStyle = UIBarStyleDefault;//为根视图的导航控制器设置右侧按钮UIBarButtonItem* rightBtn = [[UIBarButtonItem alloc] initWithTitle:@"下一页" style:UIBarButtonItemStylePlain target:self action:@selector(pressRight)];self.navigationItem.rightBarButtonItem = rightBtn;
}-(void) pressRight
{//创建新的视图控制器VCTwo* vcTwo = [[VCTwo alloc] init];//使用当前视图控制器的导航控制器对象[self.navigationController pushViewController:vcTwo animated:YES];
}

第二个视图VCTwo.h

#import "VCTwo.h"
#import "VCRoot.h"
#import "VCThree.h"
@interface VCTwo ()@end@implementation VCTwo
@synthesize elertView = _elertView;
- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.//设置视图二的标题和颜色self.view.backgroundColor = [UIColor blueColor];UIBarButtonItem* leftBtn = [[UIBarButtonItem alloc] initWithTitle:@"上一页" style:UIBarButtonItemStylePlain target:self action:@selector(pressLeft)];UIBarButtonItem* rightBtn = [[UIBarButtonItem alloc] initWithTitle:@"下一页" style:UIBarButtonItemStylePlain target:self action:@selector(pressRight)];self.navigationItem.leftBarButtonItem = leftBtn;//[self create];self.navigationItem.rightBarButtonItem = rightBtn;
}-(void) pressLeft
{//弹出当前视图控制器,返回上一个界面[self.navigationController popViewControllerAnimated:YES];
}-(void) pressRight
{VCThree* vcThree = [[VCThree alloc] init];//推入第三个视图控制器对象[self.navigationController pushViewController:vcThree animated:YES];
}

第三个视图VCThree.h

#import "VCThree.h"
#import "VCRoot.h"
#import "VCTwo.h"
@interface VCThree ()@end@implementation VCThree- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.self.view.backgroundColor = [UIColor redColor];UIBarButtonItem* leftBtn = [[UIBarButtonItem alloc] initWithTitle:@"上一页" style:UIBarButtonItemStylePlain target:self action:@selector(pressLeft)];UIBarButtonItem* rightBtn = [[UIBarButtonItem alloc] initWithTitle:@"下一页" style:UIBarButtonItemStylePlain target:self action:@selector(pressRight)];self.navigationItem.leftBarButtonItem = leftBtn;self.navigationItem.rightBarButtonItem = rightBtn;
}-(void) pressLeft
{[self.navigationController popViewControllerAnimated:YES];
}-(void) pressRight
{//弹出当前视图,返回根视图[self.navigationController popToRootViewControllerAnimated:YES];
}

效果图
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

导航栏和工具栏

ScenDelegate.m

#import "SceneDelegate.h"
#import "VCRoot.h"
@interface SceneDelegate ()@end@implementation SceneDelegate- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {VCRoot* vac = [[VCRoot alloc] init];UINavigationController* ans = [[UINavigationController alloc] initWithRootViewController:vac];self.window.rootViewController = ans;[self.window makeKeyAndVisible];
}- (void)sceneDidDisconnect:(UIScene *)scene {// Called as the scene is being released by the system.// This occurs shortly after the scene enters the background, or when its session is discarded.// Release any resources associated with this scene that can be re-created the next time the scene connects.// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}- (void)sceneDidBecomeActive:(UIScene *)scene {// Called when the scene has moved from an inactive state to an active state.// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}- (void)sceneWillResignActive:(UIScene *)scene {// Called when the scene will move from an active state to an inactive state.// This may occur due to temporary interruptions (ex. an incoming phone call).
}- (void)sceneWillEnterForeground:(UIScene *)scene {// Called as the scene transitions from the background to the foreground.// Use this method to undo the changes made on entering the background.
}- (void)sceneDidEnterBackground:(UIScene *)scene {// Called as the scene transitions from the foreground to the background.// Use this method to save data, release shared resources, and store enough scene-specific state information// to restore the scene back to its current state.
}@end

VCRoot.h

#import "VCRoot.h"
#import "VCSecond.h"
@interface VCRoot ()@end@implementation VCRoot- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.self.view.backgroundColor = [UIColor yellowColor];self.title = @"根视图";UIBarButtonItem* btn = [[UIBarButtonItem alloc] initWithTitle:@"Right" style:UIBarButtonItemStylePlain target:nil action:nil];self.navigationItem.rightBarButtonItem = btn;UINavigationBarAppearance* appearance = [[UINavigationBarAppearance alloc] init];//设置该对象的背景颜色appearance.backgroundColor = [UIColor redColor];//创建该对象的阴影图像appearance.shadowImage = [[UIImage alloc] init];//设置该对象的阴影颜色appearance.shadowColor = nil;//设置导航栏按钮的颜色self.navigationController.navigationBar.tintColor = [UIColor blueColor];//设置普通样式导航栏self.navigationController.navigationBar.standardAppearance = appearance;//设置滚动样式导航栏self.navigationController.navigationBar.scrollEdgeAppearance = appearance;self.navigationController.navigationBar.hidden = NO;self.navigationController.navigationBarHidden = NO;//显示工具栏对象//默认工具栏是隐藏的self.navigationController.toolbarHidden = NO;//设置工具栏是否透明self.navigationController.toolbar.translucent = NO;//向工具栏添加第一个按钮UIBarButtonItem* btn1 = [[UIBarButtonItem alloc] initWithTitle:@"left" style:UIBarButtonItemStylePlain target:nil action:nil];//向工具栏添加第二个按钮UIBarButtonItem* btn2 = [[UIBarButtonItem alloc] initWithTitle:@"right" style:UIBarButtonItemStylePlain target:nil action:@selector(press)];//添加一个自定义按钮UIButton *btnC = [UIButton buttonWithType: UIButtonTypeCustom];[btnC setImage: [UIImage imageNamed: @"12.png"] forState: UIControlStateNormal];btnC.frame = CGRectMake(0, 0, 60, 60);UIBarButtonItem *btn3 = [[UIBarButtonItem alloc] initWithCustomView: btnC];//设置一个占位按钮,放到数组中可以用来分隔开各按钮//设置宽度固定按钮UIBarButtonItem *btnF1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemFixedSpace target: nil action: nil];btnF1.width = 110;//设置自动计算宽度按钮UIBarButtonItem *btnF2 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemFlexibleSpace target: nil action: nil];//按钮数组的创建NSArray *arrayBtn = [NSArray arrayWithObjects: btn1, btnF2, btn3, btnF2, btn2, nil];self.toolbarItems = arrayBtn;}

效果图
在这里插入图片描述

分栏控制器

分栏控制器是管理多个视图控制器的管理控制器,通过数组的方式管理多个平行关系的视图控制器,与导航控制器的区别在于:导航控制器管理的是有层级关系的控制器

注意:
分栏控制器在同一界面最多显示5个控制器切换按钮,超过5个时会自动创建一个新的导航控制器来管理其余的控制器。

分栏控制器基础

UITabBarItem:分栏按钮元素对象
badgeValue:分栏按钮提示信息
selectedIndex:分栏控制器选中的控制器索引
viewControllers:分栏控制器管理数组
selectedViewController:分栏控制器选中的控制器对象

VCone类

#import "VCone.h"@interface VCone ()@end@implementation VCone- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.//创建一个分栏按钮对象//P1:显示的文字//P2:显示图片图标//P3:设置按钮的tagUITabBarItem* tab = [[UITabBarItem alloc] initWithTitle:@"111" image:nil tag:101];self.tabBarItem = tab;
}
@end

VCtow类

#import "VCtwo.h"@interface VCtwo ()@end@implementation VCtwo- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.//根据系统风格创建分栏按钮//P1:系统风格设定UITabBarItem* tab = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemContacts tag:111];tab.badgeValue = @"11";self.tabBarItem = tab;
}
@end

VCthree类

#import "VCthree.h"@interface VCthree ()@end@implementation VCthree- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.
}/*
#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end

SceneDelegate.m

#import "SceneDelegate.h"
#import "VCone.h"
#import "VCtwo.h"
#import "VCthree.h"@interface SceneDelegate ()@end@implementation SceneDelegate- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {//创建视图控制器1、2、3VCone* vc1 = [[VCone alloc] init];vc1.title = @"视图一";vc1.view.backgroundColor = [UIColor whiteColor];VCtwo* vc2 = [[VCtwo alloc] init];vc2.title = @"视图二";vc2.view.backgroundColor = [UIColor redColor];VCthree* vc3 = [[VCthree alloc] init];vc3.view.backgroundColor = [UIColor orangeColor];vc3.title = @"视图三";//创建分栏控制器对象UITabBarController* tbController = [[UITabBarController alloc] init];//创建一个控制器数组对象//将所有要被分栏控制器管理的对象添加到数组中去NSArray* arrVC = [NSArray arrayWithObjects:vc1, vc2, vc3, nil];//给分栏控制器管理数组赋值tbController.viewControllers = arrVC;//将分栏控制器作为根视图控制器self.window.rootViewController = tbController;//设置选中的视图控制器的索引tbController.selectedIndex = 2;//当前显示的控制器对象if(tbController.selectedViewController == vc3) {NSLog(@"Right");}//是否分栏控制器的工具栏的透明度tbController.tabBar.translucent = NO;//分栏控制器的颜色tbController.tabBar.backgroundColor = [UIColor whiteColor];}- (void)sceneDidDisconnect:(UIScene *)scene {// Called as the scene is being released by the system.// This occurs shortly after the scene enters the background, or when its session is discarded.// Release any resources associated with this scene that can be re-created the next time the scene connects.// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}- (void)sceneDidBecomeActive:(UIScene *)scene {// Called when the scene has moved from an inactive state to an active state.// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}- (void)sceneWillResignActive:(UIScene *)scene {// Called when the scene will move from an active state to an inactive state.// This may occur due to temporary interruptions (ex. an incoming phone call).
}- (void)sceneWillEnterForeground:(UIScene *)scene {// Called as the scene transitions from the background to the foreground.// Use this method to undo the changes made on entering the background.
}- (void)sceneDidEnterBackground:(UIScene *)scene {// Called as the scene transitions from the foreground to the background.// Use this method to save data, release shared resources, and store enough scene-specific state information// to restore the scene back to its current state.
}@end

效果图在这里插入图片描述

分栏控制器高级

willBeginCustomizingViewControllers:即将显示编辑方法
willEndCustomizingViewControllers:即将结束编辑方法
didEndCustomizingViewControllers:已经结束编辑方法
didSelectViewController:选中控制器切换方法

分栏控制器下面的导航栏最多显示5个按钮,超过5个按钮,系统会自动将最后一个按钮替换成more,当点击more时,才可以看到其他的按钮,点开后,右上角有一个Edit按钮,点击可以看到所有的按钮,也可拖动改变前四个按钮展现的是什么视图。

UITabBarControllerDelegate协议
先创建VCone-Vcsix类,这里指展现VCone类:

#import "VCone.h"@interface VCone ()@end@implementation VCone- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view.
}/*
#pragma mark - Navigation// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {// Get the new view controller using [segue destinationViewController].// Pass the selected object to the new view controller.
}
*/@end

SceneDelegate.m

#import "SceneDelegate.h"
#import "VCone.h"
#import "VCtwo.h"
#import "VCthree.h"
#import "VCfour.h"
#import "VCfive.h"
#import "VCsix.h"
@interface SceneDelegate ()@end@implementation SceneDelegate- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {VCone* vc1 = [[VCone alloc] init];vc1.title = @"视图1";vc1.view.backgroundColor = [UIColor redColor];VCtwo* vc2 = [[VCtwo alloc] init];vc2.title = @"视图2";vc2.view.backgroundColor = [UIColor orangeColor];VCthree* vc3 = [[VCthree alloc] init];vc3.title = @"视图3";vc3.view.backgroundColor = [UIColor blueColor];VCfour* vc4 = [[VCfour alloc] init];vc4.title = @"视图4";vc4.view.backgroundColor = [UIColor greenColor];VCfive* vc5 = [[VCfive alloc] init];vc5.title = @"视图5";vc5.view.backgroundColor = [UIColor grayColor];VCsix* vc6 = [[VCsix alloc] init];vc6.title = @"视图6";vc6.view.backgroundColor = [UIColor yellowColor];NSArray* arrVC = [NSArray arrayWithObjects:vc1, vc2, vc3, vc4, vc5, vc6, nil];UITabBarController* tb = [[UITabBarController alloc] init];tb.viewControllers = arrVC;tb.tabBar.translucent = NO;tb.tabBar.backgroundColor = [UIColor whiteColor];self.window.rootViewController = tb;//设置代理//处理UITabBarControllerDelegate协议函数tb.delegate = self;
}
//开始编译前调用此协议函数
-(void) tabBarController:(UITabBarController *)tabBarController willBeginCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers
{NSLog(@"编辑前");
}
//即将结束编译前调用此协议函数
-(void) tabBarController:(UITabBarController *)tabBarController willEndCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers changed:(BOOL)changed
{NSLog(@"即将结束前");
}
//结束编译后调用此协议函数
-(void) tabBarController:(UITabBarController *)tabBarController didEndCustomizingViewControllers:(NSArray<__kindof UIViewController *> *)viewControllers changed:(BOOL)changed
{if(changed == YES) {NSLog(@"顺序发生改变");}NSLog(@"已经结束编辑");
}
//选中控制器对象调用此协议函数
-(void) tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{NSLog(@"选中控制器对象");
}- (void)sceneDidDisconnect:(UIScene *)scene {// Called as the scene is being released by the system.// This occurs shortly after the scene enters the background, or when its session is discarded.// Release any resources associated with this scene that can be re-created the next time the scene connects.// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}- (void)sceneDidBecomeActive:(UIScene *)scene {// Called when the scene has moved from an inactive state to an active state.// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}- (void)sceneWillResignActive:(UIScene *)scene {// Called when the scene will move from an active state to an inactive state.// This may occur due to temporary interruptions (ex. an incoming phone call).
}- (void)sceneWillEnterForeground:(UIScene *)scene {// Called as the scene transitions from the background to the foreground.// Use this method to undo the changes made on entering the background.
}- (void)sceneDidEnterBackground:(UIScene *)scene {// Called as the scene transitions from the foreground to the background.// Use this method to save data, release shared resources, and store enough scene-specific state information// to restore the scene back to its current state.
}@end

效果图
在这里插入图片描述
点击more后
在这里插入图片描述
点击Edit后
在这里插入图片描述

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

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

相关文章

【STL源码剖析】deque 的使用

别院深深夏席清&#xff0c;石榴开遍透帘明。 树阴满地日当午&#xff0c;梦觉流莺时一声。 目录 deque 的结构 deque 的迭代器剖析 deque 的使用 ​编辑 deque 的初始化 deque 的容量操作 deque 的访问操作 在 pos 位置插入另一个向量的 [forst&#xff0c;last] 间的数据​编…

【人工智能Ⅱ】实验9:强化学习Q-Learning算法

实验9&#xff1a;强化学习Q-Learning算法 一&#xff1a;实验目的 1&#xff1a;了解强化学习的基本概念。 2&#xff1a;学习强化学习经典算法——Q-Learing算法。 3&#xff1a;通过Q-Learing算法解决问题。 二&#xff1a;实验内容 2.1 强化学习 强化学习&#xff08;…

iOS18新功能大爆料,打破常规,全面升级,这些变化不容错过!

众所周知&#xff0c;苹果 iOS 操作系统近年来都没有发生重大变化&#xff0c;主要是添加小部件、锁屏编辑和手机屏幕编辑等功能&#xff0c;再加上bug偏多&#xff0c;以至于越来越多iPhone用户不愿意再升级系统了。这一点&#xff0c;从 iOS 17 明显降低的安装率中就能看出一…

对人脸图像进行性别和年龄的判断

判断性别和年龄 导入必要的库加载预训练的人脸检测模型加载预训练的性别和年龄识别模型定义性别和年龄的标签列表创建Tkinter窗口&#xff1a;定义选择图片的函数&#xff1a;创建一个按钮&#xff0c;用于打开文件选择对话框定义显示图片的函数创建预测性别和年龄的函数创建预…

Docker大学生看了都会系列(二、Mac通过Homebrew安装Docker)

系列文章目录 第一章 Docker介绍 第二章 Mac通过Homebrew安装Docker 文章目录 前言Mac通过Homebrew安装本机环境系统要求terminal命令安装查看安装信息配置阿里云镜像加速登陆阿里云配置加速地址其他国内加速地址 总结 前言 在上一章了解了Docker容器是什么之后&#xff0c;本…

solidworks二维样条曲线使用实例

单位mm 绘制一个圆 直径为50mm&#xff0c; 基准面 上视基准面&#xff0c;距离50mm&#xff0c; 2个六边形 一个内嵌圆 另一个直径60mm&#xff0c; 将两个六边形改成构造线 选择样条曲线&#xff0c;将六边形的顶点连接在一起 放样曲面 插入–曲面–放样曲面 平面区域…

RabbitMQ不完整的笔记

同步的不足 1、拓展性差&#xff0c;当要添加功能时&#xff0c;需要在原来的功能代码上做修改&#xff0c;高耦合。 2、性能下降&#xff0c;调用者需要等待服务提供者执行完返回结果后&#xff0c;才能继续向下执行 3、级联失败&#xff0c;由于我们是基于OpenFeign调用交易…

Visual Studio Code使用(C++项目新建,运行)

VS Code 直接在官网下载安装。 接下来安装插件&#xff0c;下图是C所需的对应插件 1.新建项目 VS Code下载安装完成后&#xff0c;直接进入欢迎页&#xff1a; 在访达/文件夹中新建一个文件夹&#xff0c;欢迎页点击【打开】&#xff0c;选择刚刚新建的文件夹。点击第一个图…

华为OD机试 - 最大坐标值(Java 2024 D卷 100分)

华为OD机试 2024C卷题库疯狂收录中&#xff0c;刷题点这里 专栏导读 本专栏收录于《华为OD机试&#xff08;JAVA&#xff09;真题&#xff08;A卷B卷C卷&#xff09;》。 刷的越多&#xff0c;抽中的概率越大&#xff0c;每一题都有详细的答题思路、详细的代码注释、样例测试…

数据结构第三篇【链表的相关知识点一及在线OJ习题】

数据结构第三篇【链表的相关知识点一及在线OJ习题】 链表链表的实现链表OJ习题顺序表和链表的区别和联系 本文章主要讲解关于链表的相关知识&#xff0c;喜欢的可以三连喔 &#x1f600;&#x1f603;&#x1f604;&#x1f604;&#x1f60a;&#x1f60a;&#x1f643;&#…

Makefile的入门学习

一、Makefile的入门学习 编译工具及构建工具介绍 在之前的课程&#xff0c;都是直接使用gcc对代码进行编译&#xff0c;这对简单的工程是可以的&#xff0c;但当我们遇到复杂的工程时&#xff0c;每次用gcc等编译工具去操作就会显得很低效。因此make工具就出现了&#xff0c;…

LeetCode1137第N个泰波那契数

题目描述 泰波那契序列 Tn 定义如下&#xff1a; T0 0, T1 1, T2 1, 且在 n > 0 的条件下 Tn3 Tn Tn1 Tn2给你整数 n&#xff0c;请返回第 n 个泰波那契数 Tn 的值。 解析 递归应该会超时&#xff0c;可以用循环&#xff0c;或者官方解法的矩阵的幂。 public int tr…

(4) qml动态元素

文章目录 概述注意 动画元素变化的策略Animation on 变化behavior on⽤standalone animation注意 缓冲曲线&#xff08;Easing Curves&#xff09;动画分组 概述 这⼀章介绍如何控制属性值的变化&#xff0c;通过动画的⽅式在⼀段时间内来改变属性值。这项技术是建⽴⼀个现代化…

获取(复制)网页上的文字

获取&#xff08;复制&#xff09;网页上的文字 今天在搜索历史课本上一段文言文的翻译时&#xff0c;找到的网页&#xff0c;屏蔽了右键&#xff0c;不能选择&#xff0c;当然不让复制啦。对于这样的网站可以采用如下方法进行数据的获取&#xff0c;以chrome为例。 1、网页另…

keil5常见使用技巧记录(更新)

快速到函数定义 F12或自己定义快捷键CTRLK&#xff08;个人设定&#xff09; 修改快捷键 下图实例是快速跳转到函数或变量定义位置&#xff0c;当然可以定义其他功能快捷键&#xff0c;如快速注释多行&#xff0c;快速消除注释等 标记全部查找变量的蓝色框取消 CTRLshiftF2…

【YOLOv10改进[Backbone]】图像修复网络AirNet助力YOLOv10目标检测效果 + 含全部代码和详细修改方式 + 手撕结构图 + 全网首发

本文带来的是图像复原网络AirNet&#xff0c;它由基于对比度的退化编码器( CBDE )和退化引导的恢复网络( DGRN )两个模块组成。可以在一个网络中恢复各种退化图像。AirNet不受损坏类型和级别的先验限制&#xff0c;仅使用观察到的损坏图像进行推理。本文中将使用图像修复网络Ai…

使用Python绘制瀑布图

使用Python绘制瀑布图 瀑布图效果代码 瀑布图 瀑布图&#xff08;Waterfall Chart&#xff09;是一种数据可视化工具&#xff0c;用于展示累积数值的变化&#xff0c;尤其适合于展示随时间或过程中的增减变化。它通常用于财务分析&#xff0c;如展示收入、支出和净利润的变化过…

【离散数学】数理逻辑集合论知识点汇总

期末题型&#xff1a; 一、 单选题&#xff08;每题2分&#xff0c;10题共20分&#xff09; 命题判定、哈斯图边计算等 二、 填空题&#xff08;每空1分&#xff0c;共20分&#xff09; 与非和或非的表示等 三、 简答题&#xff08;10题&#xff0c;每题6分&#xff0c;共60分&…

安装禅道,帮助测试,测试打磨项目精度。

先检查docker版本。 sudo docker network create --subnet172.172.172.0/24 zentaonet sudo docker run --name zentao2 -p 8080:80 -p 3307:3306 --networkzentaonet --ip 172.172.172.3 -e MYSQL_INTERNALtrue -v /media/cykj/3T/ze…

【十年java搬砖路】Jumpserver docker版安装及配置Ldap登陆认证

Jumpserver docker 安装启动教程 拉取镜像 docker pull JumpServer启动进行前确保有Redis 和Mysql 创建jumperServer数据库 在MYSQL上执行 创建数据库 登陆MYSQL mysql -u root -p 创建Jumperserveri库 create database jumpserver default charset utf8mb4;可以为jumperSe…