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

news2025/4/8 15:12:12

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.title
    self.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 = @"哦哦哦";
    //设置导航栏的风格颜色,默认为Default
    self.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:设置按钮的tag
    UITabBarItem* 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、3
    VCone* 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.coloradmin.cn/o/1796199.html

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

相关文章

【论文阅读】SELF-RAG,让模型决策和反思检索

关于LLM何时使用RAG的问题&#xff0c;原本是阅读了关于ADAPT-LLM模型的那篇论文&#xff0c;被问到与SELF-RAG有何区别。所以&#xff0c;大概看了一下SELF-RAG这篇论文&#xff0c;确实很像&#xff0c;这些基于LLM针对下游任务的模型架构和方法&#xff0c;本来就很像。不过…

accelerate笔记:实验跟踪

Accelerate支持七种集成的跟踪器&#xff1a; TensorBoardWandBCometMLAimMLFlowClearMLDVCLive要使用这些跟踪器&#xff0c;可以通过在 Accelerator 类的 log_with 参数中传入所选类型来实现 from accelerate import Accelerator from accelerate.utils import LoggerTypeac…

Yolo-v5模型训练速度,与GeForce的AI算力描述

1.GeForce RTX3070 Ti官网参数&#xff1a; GeForce RTXTM 3070 Ti 和 RTX 3070 显卡采用第 2 代 NVIDIA RTX 架构 - NVIDIA Ampere 架构。该系列产品搭载专用的第 2 代 RT Core &#xff0c;第 3 代 Tensor Core、全新的 SM 多单元流处理器以及高速显存&#xff0c;助您在高性…

北斗RTK+UWB定位的优势

在当今科技飞速发展的时代&#xff0c;定位技术的应用已渗透到我们生活的方方面面。从导航、物流到无人驾驶、智能制造&#xff0c;精准定位技术无处不在。而北斗RTK&#xff08;Real-Time Kinematic&#xff0c;实时动态&#xff09;和UWB&#xff08;Ultra-Wideband&#xff…

闭眼推荐的,新手教师工具

亲爱的老师们&#xff0c;尤其是那些刚踏入教育界的新手教师们&#xff0c;还在为如何高效管理课堂、如何制作精美的教学材料而头疼吗&#xff1f;让我来分享几款教育界口碑爆棚的工具。 易查分小程序 易查分是一款超级方便的成绩查询工具&#xff0c;一分钟就能上传成绩并生成…

[经验] 腰果树的外观特征和特点是什么 #媒体#微信

腰果树的外观特征和特点是什么 腰果树是一种生长在热带和亚热带地区的落叶乔木&#xff0c;其叶子为互生&#xff0c;倒披针形或披针形&#xff0c;整个树枝条生长勃勃&#xff0c;长势喜人。 腰果树的树皮是灰色或深褐色的&#xff0c;有着纵向裂缝&#xff0c;树皮粗糙而有光…

【Mybatis】源码分析-高级应用

1、Mybatis配置文件深入理解 1.2、动态SQL语句 Mybatis 的映射⽂件中&#xff0c;前⾯我们的 SQL 都是⽐较简单的&#xff0c;有些时候业务逻辑复杂时&#xff0c;我们的 SQL是动态变化的&#xff0c;此时在前⾯的学习中我们的 SQL 就不能满⾜要求了。 1.2.1、条件判断 我们根…

OrangePi KunPengPro | linux系统下挂载U盘

OrangePi KunPengPro | linux系统下挂载U盘 时间&#xff1a;2024年6月6日21:32:53 文章目录 OrangePi KunPengPro | linux系统下挂载U盘1.参考2.操作fdisk -l 列出系统上所有磁盘的分区表信息将 /dev/sda1 分区挂载到 /mnt/udisk/ 目录显示文件系统的磁盘空间使用情况卸载文件…

【C++】问题及补充(2)

string s2“hello word”;是怎么进行隐式类型转换的 在这里&#xff0c;"hello world"是一个C字符串常量&#xff0c;而s2是一个std::string类型的变量。当你将C字符串常量赋值给一个std::string类型的变量时&#xff0c;会发生隐式类型转换。编译器会将C字符串常量转…

机器学习笔记 - 本地windows 11 + PyCharm运行stable diffusion流程简述

一、环境说明 硬件:本地电脑windows11、32.0 GB内存、2060的6G的卡。 软件:本地有一个python环境,主要是torch 2.2.2+cu118 二、准备工作 1、下载模型 https://huggingface.co/CompVishttps://huggingface.co/CompVis 进入上面的网址,我这里下载的是这个里面的 …

Go微服务: 分布式Cap定理和Base理论

分布式中的Cap定理 CAP理论 C: 一致性&#xff0c;是站在分布式的角度&#xff0c;要么读取到数据&#xff0c;要么读取失败&#xff0c;比如数据库主从&#xff0c;同步时的时候加锁&#xff0c;同步完成才能读到同步的数据&#xff0c;同步完成&#xff0c;才返回数据给程序&…

【ssh命令】ssh登录远程服务器

命令格式&#xff1a;ssh 用户名主机IP # 使用非默认端口: -p 端口号 ssh changxianrui192.168.100.100 -p 1022 # 使用默认端口 22 ssh changxianrui192.168.100.100 然后输入密码&#xff0c;就可以登录进去了。

多模态vlm综述:An Introduction to Vision-Language Modeling 论文解读

目录 1、基于对比学习的VLMs 1.1 CLIP 2、基于mask的VLMs 2.1 FLAVA 2.2 MaskVLM 2.3 关于VLM目标的信息理论视角 3、基于生成的VLM 3.1 学习文本生成器的例子: 3.2 多模态生成模型的示例: 3.3 使用生成的文本到图像模型进行下游视觉语言任务 4、 基于预训练主干网…

Vue——子级向父级使用props传递数据(函数)

文章目录 前言原理案例效果演示 前言 看到这个标题&#xff0c;相信很多人会说我&#xff0c;你之前博客写的父级向子级中传递数据使用的是props&#xff0c;然后说的子级向父级传递数据则是用的$emit。 并且还说了对于String、数组Array&#xff0c;只能是父级使用props传递…

UE5 Mod Support 思路——纯蓝图

原创作者&#xff1a;Chatouille 核心功能 “Get Blueprint Assets”节点&#xff0c;用于加载未来的mod。用基础类BP_Base扩展即可。打包成补丁&#xff0c;放到Content\Paks目录下&#xff0c;即可让游戏访问到内容。 与文中所写不同的地方 5.1或者5.2开始&#xff0c;打…

音视频开发—V4L2介绍,FFmpeg 打开摄像头输出yuv文件

实验平台&#xff1a;Ubuntu20.04 摄像头&#xff1a;1080P 监控摄像头&#xff0c;采用V4L2驱动框架 文章目录 1.V4L2相关介绍1.1. 基本概念1.2. 主要功能1.3. V4L2驱动框架1.4. 主要组件1.5. 使用V4L2的应用1.6. 常用V4L2工具 2.ffmpeg命令实现打开摄像头输出yuv文件3.使用C…

算法金 | 读者问了个关于深度学习卷积神经网络(CNN)核心概念的问题

​大侠幸会&#xff0c;在下全网同名[算法金] 0 基础转 AI 上岸&#xff0c;多个算法赛 Top [日更万日&#xff0c;让更多人享受智能乐趣] 读者问了个关于卷积神经网络核心概念的问题&#xff0c;如下&#xff0c; 【问】神经元、权重、激活函数、参数、图片尺寸&#xff0c;卷…

Python Excel 指定内容修改

需求描述 在处理Excel 自动化时,财务部门经常有一个繁琐的场景,需要读取分发的Excel文件内容复制到汇总Excel文件对应的单元格内,如下图所示: 这种需求可以延申为,财务同事制作一个模板,将模板发送给各员工,财务同事需收取邮件将员工填写的excel文件下载到本机,再类似…

jenkins的简单使用

2.1.简介 Jenkins是一个开源软件项目&#xff0c;是基于Java开发的一种持续集成工具&#xff0c;用于监控持续重复的工作&#xff0c;旨在提供一个开放易用的软件平台&#xff0c;使软件的持续集成变成可能。 2.4.Jenkins安装 1.下载安装包jenkins.war&#xff1b; 2.在安装…

夕小瑶:资本寒冬下的AI创业一年

几天前我和几位前大厂朋友约了个饭&#xff0c;朋友纷纷向我透露出一种纠结&#xff1a; “GPT-4o将催生一大波创业机会啊&#xff0c;想离职” “但是现在是资本寒冬啊” “好想像你一样勇敢啊” 说起来这两年的大厂打工人确实比较难&#xff0c;受经济大环境影响&#xff0…