iOS NSAttributedString(属性字符串)

2023-05-16

NSAttributedString实际上就是一个字符串和一本字典。

字典包含每一个字符的属性:包括字体、大小、下划线、颜色等等。

关键是要知道字典中每个key的含义以及相应value的取值范围

Character Attributes(重点)

NSString *const  NSFontAttributeName ;                   // 设置字体,UIFont对象,默认12-point Helvetica(Neue)
NSString *const  NSParagraphStyleAttributeName ;         // (重要)设置段落风格,NSParagraphStyle对象,默认是[NSParagraphStyle defaultParagraphStyle],这里可以设置很多段落格式,首行缩进之类的
NSString *const  NSForegroundColorAttributeName ;        // 字体颜色,UIColor对象,默认黑色
NSString *const  NSBackgroundColorAttributeName ;        // 背景色,UIColor对象,默认透明
NSString *const  NSLigatureAttributeName ;               // <span style="color:#FF0000;">(********)不知道干嘛用</span>
NSString *const  NSKernAttributeName ;                   // 字符间距,NSNumber 浮点数,默认为0
NSString *const  NSStrikethroughStyleAttributeName ;     // 删除线的线粗,NSNumber 整数,默认是NSUnderlineStyleNone(你真的没看错)
NSString *const  NSUnderlineStyleAttributeName ;         // 下划线的线粗,NSNumber 整数,默认同上,还有别的样式,例如双下划线
NSString *const  NSStrokeColorAttributeName ;            // 描边颜色,UIColor对象,默认同字体颜色
NSString *const  NSStrokeWidthAttributeName ;            // 描边,NSNumber 浮点数,正值表示镂空描边,负值标志填充描边,值表示描边线粗
NSString *const  NSShadowAttributeName ;                 // 阴影,NSShadow对象,效果参照最后的图片
NSString *const  NSTextEffectAttributeName ;             // 文本风格,NSSting对象,默认为nil,官方举例NSTextEffectLetterpressStyle,其实也就只有这个风格。。。感觉有跟没有差不多
NSString *const  NSAttachmentAttributeName ;             // <span style="color:#FF0000;">(********)文本附件属性</span>, NSTextAttachment对象,其中包含有图片,等我找到典型案例再回来重新介绍
NSString *const  NSLinkAttributeName ;                   // 链接某个地址,NSURL(推荐)或NSString对象,默认为nil不指定任何链接。这里有详细介绍,http://blog.csdn.net/reylen/article/details/18958995
NSString *const  NSBaselineOffsetAttributeName ;         // 基线偏移量,NSNumber 浮点数,可以上下微调字体的位置。(适合那些返回位置信息不正确的字体)
NSString *const  NSUnderlineColorAttributeName ;         // 下划线颜色
NSString *const  NSStrikethroughColorAttributeName ;     // 删除线颜色
NSString *const  NSObliquenessAttributeName ;            // 斜体,NSNumber 浮点数,默认0,数值表示倾斜度
NSString *const  NSExpansionAttributeName ;              // 水平拉伸,NSNumber 浮点数,默认0,水平拉伸字体,高度不变。
NSString *const  NSWritingDirectionAttributeName ;       // <span style="color:#FF0000;">(********)</span>书写方向,NSArray NSNumber(而且只能是整数0,1,2,3),没看到什么效果,找到案例再来更新
NSString *const  NSVerticalGlyphFormAttributeName;       // 水平或垂直显示,NSNumber(只有0:水平和1:垂直),没看到效果。。。

Text Writing Direction

用于"NSWritingDirectionAttributeName"

typedef enum : NSInteger  {
   NSTextWritingDirectionEmbedding      = (0 << 1),
   NSTextWritingDirectionOverride       = (1 << 1)
} NSTextWritingDirection;

Text Effect Attribute

用于"NSTextEffectAttributeName"

NSString *const  NSTextEffectLetterpressStyle;

Underline and Strikethrough Style Attributes

用于"NSUnderlineStyleAttributeName"和"NSStrikethroughStyleAttributeName"

typedef enum : NSInteger  {
   NSUnderlineStyleNone  = 0x00 ,
   NSUnderlineStyleSingle  = 0x01 ,
   NSUnderlineStyleThick  = 0x02 ,
   NSUnderlineStyleDouble  = 0x09 ,
   NSUnderlinePatternSolid  = 0x0000 ,
   NSUnderlinePatternDot  = 0x0100 ,
   NSUnderlinePatternDash  = 0x0200 ,
   NSUnderlinePatternDashDot  = 0x0300 ,
   NSUnderlinePatternDashDotDot  = 0x0400 ,
   NSUnderlineByWord  = 0x8000 
} NSUnderlineStyle;

String Drawing Options

enum {
   NSStringDrawingTruncatesLastVisibleLine  = 1 << 5,
   NSStringDrawingUsesLineFragmentOrigin  = 1 << 0,
   NSStringDrawingUsesFontLeading  = 1 << 1,
   NSStringDrawingUsesDeviceMetrics  = 1 << 3,
};
typedef NSInteger  NSStringDrawingOptions;


Document Types

NSString  *NSPlainTextDocumentType;
NSString  *NSRTFTextDocumentType;
NSString  *NSRTFDTextDocumentType;
NSString  *NSHTMLTextDocumentType;

Keys for Options and Document Attributes Dictionaries

NSString *const  NSDocumentTypeDocumentAttribute ;
NSString *const  NSCharacterEncodingDocumentAttribute ;
NSString *const  NSDefaultAttributesDocumentAttribute ;
NSString *const  NSPaperSizeDocumentAttribute ;
NSString *const  NSPaperMarginDocumentAttribute ;
NSString *const  NSViewSizeDocumentAttribute ;
NSString *const  NSViewZoomDocumentAttribute ;
NSString *const  NSViewModeDocumentAttribute ;
NSString *const  NSReadOnlyDocumentAttribute ;
NSString *const  NSBackgroundColorDocumentAttribute ;
NSString *const  NSHyphenationFactorDocumentAttribute ;
NSString *const  NSDefaultTabIntervalDocumentAttribute ;
NSString *const  NSTextLayoutSectionsAttribute;

Text Layout Sections Attribute

NSString  *NSTextLayoutSectionOrientation;
NSString  *NSTextLayoutSectionRange;


NSString的属性常量,貌似部分可以用在Character Attributes里面

UILineBreakMode已由NSLineBreakMode代替。Keys for Text Attributes Dictionaries已在ios 7中被抛弃。剩下以下三类常量可以使用。

NSTextAlignment:

enum {
   NSTextAlignmentLeft       = 0,
   NSTextAlignmentCenter     = 1,
   NSTextAlignmentRight      = 2,
   NSTextAlignmentJustified  = 3,   // 两端对齐
   NSTextAlignmentNatural    = 4,
};
typedef NSInteger  NSTextAlignment;


UIBaselineAdjustment:

用于"NSBaselineOffsetAttributeName"字符属性

typedef enum {
   UIBaselineAdjustmentAlignBaselines ,   // 根据文字的baseLine调整
   UIBaselineAdjustmentAlignCenters ,     // 根据框的水平中心线调整
   UIBaselineAdjustmentNone ,             // 以左上角为基准,默认对齐方式
} UIBaselineAdjustment;

NSWritingDirection:
enum {
   NSWritingDirectionNatural  = -1,      // Use the Unicode Bidi algorithm rules P2 and P3 to determine which direction to use.
   NSWritingDirectionLeftToRight  =  0,  // 从左到右
   NSWritingDirectionRightToLeft  =  1   // 从右到左
};

------------------------------------------------------------------------------------------------------------------------------------------------------------------


UITextViewDelegate调用流程:

1.点击TextView内部,出现光标前。

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView;

如果返回NO,则不会进入编辑,不会出现光标,也不会调用textViewDidBeginEditing:方法。

当选定点选字符串中其他位置,还是会调用didChangeSelection方法

2.出现光标后

- (void)textViewDidBeginEditing:(UITextView *)textView;
3.移动光标或选定某些字符串

- (void)textViewDidChangeSelection:(UITextView *)textView;

4.添加、删除一个字符

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
<pre name="code" class="objc">- (void)textViewDidChangeSelection:(UITextView *)textView;
- (void)textViewDidChange:(UITextView *)textView;


  

如果第1个方法返回NO,不会调用下面两个方法。

5.不知道怎么结束编辑。。。先留着。(***)

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

附类定义

UITextView

NS_CLASS_AVAILABLE_IOS(2_0) @interface UITextView : UIScrollView <UITextInput>

@property(nonatomic,assign) id<UITextViewDelegate> delegate;    // 代理
@property(nonatomic,copy) NSString *text;
@property(nonatomic,retain) UIFont *font;
@property(nonatomic,retain) UIColor *textColor;
@property(nonatomic) NSTextAlignment textAlignment;    // default is NSLeftTextAlignment

@property(nonatomic) NSRange selectedRange;
@property(nonatomic,getter=isEditable) BOOL editable;
@property(nonatomic,getter=isSelectable) BOOL selectable NS_AVAILABLE_IOS(7_0); // toggle selectability, which controls the ability of the user to select content and interact with URLs & attachments
@property(nonatomic) UIDataDetectorTypes dataDetectorTypes NS_AVAILABLE_IOS(3_0);

@property(nonatomic) BOOL allowsEditingTextAttributes NS_AVAILABLE_IOS(6_0); // defaults to NO
@property(nonatomic,copy) NSAttributedString *attributedText NS_AVAILABLE_IOS(6_0); // default is nil
@property(nonatomic,copy) NSDictionary *typingAttributes NS_AVAILABLE_IOS(6_0); // automatically resets when the selection changes

- (void)scrollRangeToVisible:(NSRange)range;


// Presented when object becomes first responder.  If set to nil, reverts to following responder chain.  If
// set while first responder, will not take effect until reloadInputViews is called.
@property (readwrite, retain) UIView *inputView;             
@property (readwrite, retain) UIView *inputAccessoryView;

@property(nonatomic) BOOL clearsOnInsertion NS_AVAILABLE_IOS(6_0); // defaults to NO. if YES, the selection UI is hidden, and inserting text will replace the contents of the field. changing the selection will automatically set this to NO.

// Create a new text view with the specified text container (can be nil) - this is the new designated initializer for this class
- (instancetype)initWithFrame:(CGRect)frame textContainer:(NSTextContainer *)textContainer NS_AVAILABLE_IOS(7_0);

// Get the text container for the text view
@property(nonatomic,readonly) NSTextContainer *textContainer NS_AVAILABLE_IOS(7_0);
// Inset the text container's layout area within the text view's content area
@property(nonatomic, assign) UIEdgeInsets textContainerInset NS_AVAILABLE_IOS(7_0);

// Convenience accessors (access through the text container)
@property(nonatomic,readonly) NSLayoutManager *layoutManager NS_AVAILABLE_IOS(7_0);
@property(nonatomic,readonly,retain) NSTextStorage *textStorage NS_AVAILABLE_IOS(7_0);

// Style for links
@property(nonatomic, copy) NSDictionary *linkTextAttributes NS_AVAILABLE_IOS(7_0);

@end

UIKIT_EXTERN NSString * const UITextViewTextDidBeginEditingNotification;
UIKIT_EXTERN NSString * const UITextViewTextDidChangeNotification;
UIKIT_EXTERN NSString * const UITextViewTextDidEndEditingNotification;


NSAttributedString

@interface NSAttributedString : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>

@property (readonly, copy) NSString *string;
- (NSDictionary *)attributesAtIndex:(NSUInteger)location effectiveRange:(NSRangePointer)range;

@end

@interface NSAttributedString (NSExtendedAttributedString)

@property (readonly) NSUInteger length;
- (id)attribute:(NSString *)attrName atIndex:(NSUInteger)location effectiveRange:(NSRangePointer)range;
- (NSAttributedString *)attributedSubstringFromRange:(NSRange)range;

- (NSDictionary *)attributesAtIndex:(NSUInteger)location longestEffectiveRange:(NSRangePointer)range inRange:(NSRange)rangeLimit;
- (id)attribute:(NSString *)attrName atIndex:(NSUInteger)location longestEffectiveRange:(NSRangePointer)range inRange:(NSRange)rangeLimit;

- (BOOL)isEqualToAttributedString:(NSAttributedString *)other;

- (instancetype)initWithString:(NSString *)str;
- (instancetype)initWithString:(NSString *)str attributes:(NSDictionary *)attrs;
- (instancetype)initWithAttributedString:(NSAttributedString *)attrStr;

typedef NS_OPTIONS(NSUInteger, NSAttributedStringEnumerationOptions) {
  NSAttributedStringEnumerationReverse = (1UL << 1),
  NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = (1UL << 20)
};

- (void)enumerateAttributesInRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void (^)(NSDictionary *attrs, NSRange range, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);
- (void)enumerateAttribute:(NSString *)attrName inRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void (^)(id value, NSRange range, BOOL *stop))block NS_AVAILABLE(10_6, 4_0);

@end

NS_CLASS_AVAILABLE(10_0, 3_2)
@interface NSMutableAttributedString : NSAttributedString

- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)str;
- (void)setAttributes:(NSDictionary *)attrs range:(NSRange)range;

@end

@interface NSMutableAttributedString (NSExtendedMutableAttributedString)

@property (readonly, retain) NSMutableString *mutableString;

- (void)addAttribute:(NSString *)name value:(id)value range:(NSRange)range;
- (void)addAttributes:(NSDictionary *)attrs range:(NSRange)range;
- (void)removeAttribute:(NSString *)name range:(NSRange)range;

- (void)replaceCharactersInRange:(NSRange)range withAttributedString:(NSAttributedString *)attrString;
- (void)insertAttributedString:(NSAttributedString *)attrString atIndex:(NSUInteger)loc;
- (void)appendAttributedString:(NSAttributedString *)attrString;
- (void)deleteCharactersInRange:(NSRange)range;
- (void)setAttributedString:(NSAttributedString *)attrString;

- (void)beginEditing;
- (void)endEditing;

@end

代理协议UITextViewDelegate

@protocol UITextViewDelegate <NSObject, UIScrollViewDelegate>

@optional

- (BOOL)textViewShouldBeginEditing:(UITextView *)textView;
- (BOOL)textViewShouldEndEditing:(UITextView *)textView;

- (void)textViewDidBeginEditing:(UITextView *)textView;
- (void)textViewDidEndEditing:(UITextView *)textView;

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text;
- (void)textViewDidChange:(UITextView *)textView;

- (void)textViewDidChangeSelection:(UITextView *)textView;

- (BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange NS_AVAILABLE_IOS(7_0);
- (BOOL)textView:(UITextView *)textView shouldInteractWithTextAttachment:(NSTextAttachment *)textAttachment inRange:(NSRange)characterRange NS_AVAILABLE_IOS(7_0);

@end

NSShadow

NS_CLASS_AVAILABLE_IOS(6_0) @interface NSShadow : NSObject <NSCopying, NSCoding>

@property (nonatomic, assign) CGSize shadowOffset;      // 影子与字符串的偏移量
@property (nonatomic, assign) CGFloat shadowBlurRadius; // 影子的模糊程度
@property (nonatomic, retain) id shadowColor;           // 影子的颜色

@end

shadow属性的效果

NSShadow *shadow = [[NSShadow alloc]init];
    shadow.shadowOffset = CGSizeMake(5, 5);     // 影子偏移量
    shadow.shadowColor = [UIColor blueColor];   // 影子颜色
    shadow.shadowBlurRadius = 20.0;             // 模糊程度
    
    
    NSDictionary *dict = @{
                           NSFontAttributeName:[UIFont fontWithName:@"Marion-Italic" size:50.0],
                           NSShadowAttributeName:shadow,
                           NSKernAttributeName:@(2)
                           };
    textView.attributedText = [[NSAttributedString alloc]initWithString:@"中文究竟是\nEnglishReally" attributes:dict];




功能太强大,一天总结不完。以后用到再上来补充。

如果你有一些iOS文字处理的问题,欢迎评论交流。




  


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

iOS NSAttributedString(属性字符串) 的相关文章

  • IntelliJ IDEA集成maven

    一 idea中maven的配置 1 maven配置 首先需要在idea中对maven进行集成 xff0c 目录为File Setting Build Execution Deployment Build Tools maven xff0c
  • 批量替换tab为空格

    利用find 找出需要替换的文件 xff0c 然后使用sed命令执行替换 如将src 路径下的所有cpp 文件的tab 替换为空格的命令如下 sed span class hljs attribute i span span class h
  • idea工具集成配置maven最详细的

    IDEA 全称 IntelliJ IDEA xff0c 是java语言开发的集成环境 xff0c IntelliJ在业界被公认为最好的Java开发工具之一 IDEA是JetBrains公司的产品 现在有逐步取代老牌Java开发工具Eclip
  • Maven的安装与配置

    一 安装本地Maven tips 官网为外网 xff0c 下载速度较慢 xff0c 这里提供3 6 3版本的三方链接下载Maven下载 无视下载速度以及需要其他版本的伙伴点此进入Maven官网下载 选择左侧Download 点击箭头所指的链
  • Maven骨架

    Maven骨架 Maven骨架简单的来说就是一种模型 结构 xff0c Maven根据我们的不同的项目和需求 xff0c 提供了不同的模型 xff0c 这样就不需要我们自己建模型了 举个简单的例子 xff1a 就比如我们要做一套普通的楼房
  • 实现分页功能

    可以先看这个 xff08 1 xff09 https www baidu com link url 61 1O13jXHEC3F2wEP5jCw0KQZCsjW4S7LFdruGJxbJO7G8dkAFgLA2sNKe48F5vOjmP8G
  • jsp中select数据回显

    xff08 1 xff09 https blog csdn net qq 23190729 article details 76774801 utm medium 61 distribute pc relevant none task bl
  • 简单的jsp插入多条数据

    lt 64 page import 61 34 java sql Connection 34 gt lt 64 page import 61 34 java sql Statement 34 gt lt 64 page import 61
  • Servlet数据库连接池

    使用连接池连接数据库 首先在一下apache中的conf文件夹中的context xml文件添加下面这段配置信息 lt Resource name 61 34 jdbc message 34 auth 61 34 Container 34
  • 数据库连接池在TOMCAT中的几种配置方法

    https www cnblogs com jay36 p 7684000 html 还有 C3P0数据库连接池 阿里druid数据库连接池 https www cnblogs com fxbin p 11854367 html https
  • 在idea中的过滤器

    https blog csdn net u010835486 article details 80730745 案例 xff1a https www bilibili com video av543581547
  • Session

    概念 https www runoob com jsp jsp session html 使用 https www cnblogs com bhlsheji p 4015568 html 登录案例 https blog csdn net q
  • E: package ‘gcc‘ has no installation candidate

    E package gcc has no installation candidate 问题描述 第一次使用gcc编译c语言代码时出现command gcc not found but can be installed with sudo
  • ANOMALY: use of REX.w is meaningless (default operand size is 64)

    1 针对所有程序 注册表中增加项 计算机 HKEY LOCAL MACHINE SOFTWARE TEC Ocular 3 agent config 下 新建 字符串值 hookapi disins 数值数据 1 2 针对特定程序 注册表中
  • google启动错误

  • 安装dlib前需要先安装cmake 和boost。然后才能正确安装dlib

    pip install boost pip install cmake pip install dib
  • anconda国内镜像源

    1 为conda配置 xff08 清华 xff09 镜像源 使用conda进行安装时 xff0c 访问的是国外的网络 xff0c 所以下载和安装包时会特别慢 我们需要更换到国内镜像源地址 xff0c 这里我更换到国内的清华大学地址 xff0
  • Anaconda常用命令大全

    使用conda 首先我们将要确认你已经安装好了conda 配置环境 下一步我们将通过创建几个环境来展示conda的环境管理功能 使你更加轻松的了解关于环境的一切 我们将学习如何确认你在哪个环境中 xff0c 以及如何做复制一个环境作为备份
  • openCV错误模块‘cv2.face‘没有属性‘createEigenFaceRecognizer‘(openCV Error module &#39;cv2.face&#39; has no at

    pip uninstall opencv contrib python pip install opencv contrib python no cache dir 功能也更改为此 load被替换为read import cv2 recog
  • Python enumerate() 函数

    enumerate 函数用于将一个可遍历的数据对象 如列表 元组或字符串 组合为一个索引序列 xff0c 同时列出数据和数据下标 xff0c 一般用在 for 循环当中 Python 2 3 以上版本可用 xff0c 2 6 添加 star

随机推荐

  • python3 opencv3 实现基本的人脸检测、识别功能

    encoding utf 8 老杨的猫 环境 PYCHARM xff0c python3 6 opencv3 import cv2 os import cv2 face as fc 此处有坑 找不到脸 这样引用程序可以运行 xff0c 欢迎
  • idea修改maven镜像

    https jingyan baidu com article c33e3f482455d2ea15cbb526 html https blog csdn net qq 32588349 article details 51461182 阿
  • Error:(1, 1) java: 非法字符: ‘\ufeff‘

    一 问题 用IDEA打开eclipse java项目编译时 xff0c 出现以下错误 xff1a Error 1 1 java 非法字符 ufeff Error 1 10 java 需要class interface或enum 二 原因分析
  • Zemax学习笔记(4)- 设计单透镜实例_1,设置

    Zemax学习笔记 xff08 4 xff09 设计单透镜 1 xff0c 设置 简介镜头分类参数和设计约束镜头数据编辑器定义系统设置定义视场设置波长插入表面输入镜头数据求解 设计单透镜分为3个部分 xff0c 设置 分析和优化 xff0c
  • libnet安装配置

    安装编译 1 下载安装包 http sourceforge net projects libnet dev 2 解压 tar zxvf libnet 1 2 rc3 tar gz 3 进去编译 configure make make ins
  • idea 创建Spring第一个项目

    1 知道什么是maven 网上一般说maven是一个构建工具 xff0c 其实是说得很准确的 xff0c 不过我觉得更准确的说法应该是一个自动化的构建工具 你可以这样说 xff1a 不用maven的时候所有的jar都不是你家的 xff0c
  • anconda 安装dlib

    pip install CMake pip install Boost 前面两个不知道有没有用 xff0c 我是直接安装了 pip install dlib 会直接报错 xff0c 所以要到网上下载whl文件来安装 xff0c 就可以了 用
  • nodejs学习五:sequelize数据库查询的Op方法

    span class token comment 查找users表数据name span span class token keyword const span op span class token operator span model
  • 使用diskpart修复EFI分区变主分区的问题

    diskgenius有时操作EFI分区会把EFI变成主分区 xff0c 太弱智了 xff0c 呵呵 xff0c 但是这个EFI分区本身有可能会变成主分区 xff0c 这样的话系统就无法识别了 xff0c Win8 1系统的diskpart可
  • 程序员会设计后是一种什么样的感觉

    我是一个iOS开发的程序员 xff0c 也是一个自由职业者 平时靠接一些外包和做自己的产品为生 做了这么多年 xff0c 给我的感觉是 xff1a 如果你只会写程序 xff0c 那么做自由职业者的空间要小很多 01 我为什么要学设计 做自己
  • win10笔记本使用virtualbox鼠标失灵

    win10笔记本使用virtualbox6时 xff0c 发现鼠标移动偏差极大 xff0c 完全无法操作虚拟机 解决方法 xff1a 虚拟机设置中将指点设备切换为USB触控板 xff0c 运行虚拟机后右下角鼠标处右键 xff0c 勾选鼠标集
  • SpringMVC的常用注解

    SpringMVC的常用注解 1 64 Controller 64 Controller 用于标记在一个类上 xff0c 使用它标记的类就是一个SpringMVC Controller 对象 2 64 RequestMapping 用于处理
  • Hive学习之修改表、分区、列

    修改表的语句允许改变现有表的结构 通过该语句可以增加列 分区 修改SerDe 增加表和SerDe的属性或者重命名表 与之类似 修改分区的语句可以改变指定分区的属性 重命名表 重命名表的语句如下 ALTER TABLE table name
  • sftp通过秘钥上传,修改文件

    sftp是通过openssh与服务端建立连接的 xff0c 默认端口为22 1 新建一个sftp的用户 xff0c 这里就叫sftp useradd span class hljs operator s span sbin nologin
  • 说说win32 控制台应用程序、win32 项目、mfc项目、空项目那些事儿

    首先 xff0c 说一下空项目 xff0c 大多数想单纯创建c 43 43 工程的新同学 xff0c 打开vs后很可能不知道选择创建什么工程 xff0c 这时候请相信我 xff0c 空项目是你最好的选择 因为空工程不包含任何的源代码文件 x
  • Docker常用命令,使用脚本在线或者离线安装Docker

    查看 停止 删除container 查看运行的容器 docker ps 查看所有容器 docker ps a 查看所有容器id docker ps aq 先停止运行container xff0c 再删除container xff0c 再删除
  • Spring配置数据源(XML)

    1 数据源 xff08 连接池 xff09 的作用 数据源 连接池 是提高程序性能如出现的 事先实例化数据源 xff0c 初始化部分连接资源 使用连接资源时从数据源中获取 使用完毕后将连接资源归还给数据源 常见的数据源 连接池 xff1a
  • Python开发GUI工具介绍,实战:将图片转化为素描画!

    阳光普照好刺眼 7月华为云社区与csdn联合举办了黑马程序员的征文活动 xff0c 由于规则简单 xff08 保证原创文章 内容为技术类为主 且文章篇幅1000字 43 即可 xff09 xff0c 所以兴高采烈的参加了活动 本来是抱着打酱
  • spring boot配置加载不出来?

    新建一个项目发现不能用 xff0c maven依赖加载不出来 xff0c 问题界面如下 xff1a 可以明确是maven依赖出了问题 xff0c 检查配置 1 xff09 检查本地仓库是否配置正确 xff1a span class toke
  • iOS NSAttributedString(属性字符串)

    NSAttributedString实际上就是一个字符串和一本字典 字典包含每一个字符的属性 xff1a 包括字体 大小 下划线 颜色等等 关键是要知道字典中每个key的含义以及相应value的取值范围 Character Attribut