*/ UIKIT_EXTERN NSString *const NSFontAttributeName NS_AVAILABLE_IOS(6_0); // UIFont, default Helvetica(Neue) 12 UIKIT_EXTERN NSString *const NSParagraphStyleAttributeName NS_AVAILABLE_IOS(6_0); // NSParagraphStyle, default defaultParagraphStyle UIKIT_EXTERN NSString *const NSForegroundColorAttributeName NS_AVAILABLE_IOS(6_0); // UIColor, default blackColor UIKIT_EXTERN NSString *const NSBackgroundColorAttributeName NS_AVAILABLE_IOS(6_0); // UIColor, default nil: no background UIKIT_EXTERN NSString *const NSLigatureAttributeName NS_AVAILABLE_IOS(6_0); // NSNumber containing integer, default 1: default ligatures, 0: no ligatures UIKIT_EXTERN NSString *const NSKernAttributeName NS_AVAILABLE_IOS(6_0); // NSNumber containing floating point value, in points; amount to modify default kerning. 0 means kerning is disabled. (note: values other than nil and 0 are unsupported on iOS) UIKIT_EXTERN NSString *const NSStrikethroughStyleAttributeName NS_AVAILABLE_IOS(6_0); // NSNumber containing integer, default 0: no strikethrough UIKIT_EXTERN NSString *const NSUnderlineStyleAttributeName NS_AVAILABLE_IOS(6_0); // NSNumber containing integer, default 0: no underline UIKIT_EXTERN NSString *const NSStrokeColorAttributeName NS_AVAILABLE_IOS(6_0); // UIColor, default nil: same as foreground color UIKIT_EXTERN NSString *const NSStrokeWidthAttributeName NS_AVAILABLE_IOS(6_0); // NSNumber containing floating point value, in percent of font point size, default 0: no stroke; positive for stroke alone, negative for stroke and fill (a typical value for outlined text would be 3.0) UIKIT_EXTERN NSString *const NSShadowAttributeName NS_AVAILABLE_IOS(6_0); // NSShadow, default nil: no shadow UIKIT_EXTERN NSString *const NSTextEffectAttributeName NS_AVAILABLE_IOS(7_0); // NSString, default nil: no text effect UIKIT_EXTERN NSString *const NSAttachmentAttributeName NS_AVAILABLE_IOS(7_0); // NSTextAttachment, default nil UIKIT_EXTERN NSString *const NSLinkAttributeName NS_AVAILABLE_IOS(7_0); // NSURL (preferred) or NSString UIKIT_EXTERN NSString *const NSBaselineOffsetAttributeName NS_AVAILABLE_IOS(7_0); // NSNumber containing floating point value, in points; offset from baseline, default 0 UIKIT_EXTERN NSString *const NSUnderlineColorAttributeName NS_AVAILABLE_IOS(7_0); // UIColor, default nil: same as foreground color UIKIT_EXTERN NSString *const NSStrikethroughColorAttributeName NS_AVAILABLE_IOS(7_0); // UIColor, default nil: same as foreground color UIKIT_EXTERN NSString *const NSObliquenessAttributeName NS_AVAILABLE_IOS(7_0); // NSNumber containing floating point value; skew to be applied to glyphs, default 0: no skew UIKIT_EXTERN NSString *const NSExpansionAttributeName NS_AVAILABLE_IOS(7_0); // NSNumber containing floating point value; log of expansion factor to be applied to glyphs, default 0: no expansion UIKIT_EXTERN NSString *const NSWritingDirectionAttributeName NS_AVAILABLE_IOS(7_0); // NSArray of NSNumbers representing the nested levels of writing direction overrides as defined by Unicode LRE, RLE, LRO, and RLO characters. The control characters can be obtained by masking NSWritingDirection and NSTextWritingDirection values. LRE: NSWritingDirectionLeftToRight|NSTextWritingDirectionEmbedding, RLE: NSWritingDirectionRightToLeft|NSTextWritingDirectionEmbedding, LRO: NSWritingDirectionLeftToRight|NSTextWritingDirectionOverride, RLO: NSWritingDirectionRightToLeft|NSTextWritingDirectionOverride, UIKIT_EXTERN NSString *const NSVerticalGlyphFormAttributeName NS_AVAILABLE_IOS(6_0); // An NSNumber containing an integer value. 0 means horizontal text. 1 indicates vertical text. If not specified, it could follow higher-level vertical orientation settings. Currently on iOS, it's always horizontal. The behavior for any other value is undefined.
相关推荐
navigationController.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black] ``` 3. **自定义导航栏标题视图** `GKNavigationBar`支持自定义标题视图,你可以用自定义...
let attributes: [NSAttributedString.Key: Any] = [.foregroundColor: UIColor.white, .font: UIFont.systemFont(ofSize: 16)] YTToast.showToast(withText: "Custom attributes", duration: 2.0, position: ....
首先,我们需要创建一个名为`UILabel+YBAttributeTextTapAction`的Category,包含头文件`UILabel+YBAttributeTextTapAction.h`和实现文件`UILabel+YBAttributeTextTapAction.m`。在头文件中,我们声明一个block类型...
NSAttributedString是一个包含了样式信息(如字体、颜色、下划线等)和基础文本的数据结构,它可以轻松地表示富文本。你可以使用NSAttributedString的构造方法或者NSMutableAttributedString的append方法来组合和...
需要注意的是,如果文本包含富文本(如不同的颜色、字体或链接),你可能需要使用`NSAttributedString`。在这种情况下,`AttributedLabel`需要进一步处理`NSAttributedString`。你可以在`AttributedLabel`类中添加对...
开发者可能在这里使用`UIImage`和`NSAttributedString`来定制文字和图标,或者使用其他自定义控件替换默认的`UITabBarItem`。 ### 4. Masonry 布局库 提到`Masonry`,这是一个流行的iOS Auto Layout的轻量级库,...
#import "NSAttributedString+JTATEmoji.h" NSString *normalStr = @"This category allows you to convert string into given image like this [kiss] and this [hug]"; myTextView.attributedText = ...
NSAttributedString *attributedTitle = [[NSAttributedString alloc] initWithString:self.title attributes:@{NSFontAttributeName: self.customFont}]; [attributedTitle drawInRect:dirtyRect withAttributes:...
1. **源代码文件**:项目的核心代码很可能包含一个或多个.m和.h文件,其中.m文件是实现Objective-C类的实现部分,而.h文件则定义了接口和类的公共属性与方法。这些文件将展示如何创建和使用自定义的渐变文本视图。 ...
BQPopup A PopupController which can scroll when contains a lot of subviews. ... * BQPopupHeight, when popupStyle is BQPopupStyleActionSheet,if popupHeight less than or equal keyWindow.frame.size.h
#import <CoreText/CoreText.h> ``` CoreText主要通过`CTTypesetter`、`CTFrame`和`CTLine`等类来处理文本。在图文混排中,我们通常会创建一个`NSAttributedString`对象,它允许我们将不同样式(如字体、颜色)的...
h. progressView(默认为VOringProgressVIew) 如果有progress或者moveDistance属性,会自动设置这2个属性,达到拉动时的动画效果,可以看演示动画中使用的UIProgressView i. 自定义状态文字使用NSAttributedString可以...
HZ扩展类别UIColor , UIButton , UIAlertView , UIView , NSDate , NSFileManager , NSDictionary , NSString , UIImage , NSData , NSAttributedString , NSURL , NSArray 。 一些常见的宏和助手类。 ...
1. `BALabel`源代码文件夹:这可能包括`.swift`或`.m/.h`文件,是"BALabel"的主要实现代码。 2. 示例项目文件:可能有一个包含"BALabel"使用示例的Xcode工程,开发者可以通过运行此项目来了解其功能和用法。 3. `...
#import "DTCoreText.h" ``` 3. **使用DTCoreText解析HTML** 要将HTML字符串转换为NSAttributedString,可以使用`DTHTMLAttributedStringBuilder`类: ```objc NSString *htmlString = @"<p>这是一段带格式的...
self.attributedText = [[NSAttributedString alloc] initWithString:formattedText]; } @end ``` 在这个例子中,我们假设手机号码的标准格式是11位数字,前三位为区号,中间四位为城市代码,后面四位为个人号码...
一个NSString和NSAttributedString类别,可以轻松翻转和反转文本。 翻转后的文本可以通过短信,电子邮件等发送。 ##用法 # import TextFlipKit.h; - ( void )foo { NSString *example = @" Example String " ; ...
首先,从提供的文件名"LeenRichText.h"和"LeenRichText.m"我们可以推断,这可能是一个名为"LeenRichText"的自定义类,实现了图文混排的功能。通常,这样的类会包含处理文本和图像的方法,以及可能的布局逻辑。 在...
DaiInboxHUD这是一个模仿google inbox 转圈效果的HUD.加入成功时候打勾的动画失败时候画叉叉的动画 ...如果想要秀带讯息的hud 可以调用[DaiInboxHUD showMessage:[[NSAttributedString alloc] initWithStrin
在`.h`文件中导入CoreText框架,以便在`.m`文件中使用相关API。 3. **设置视图并绘制文本**:在XIB文件中,将应用的主视图替换为`CTView`。接着,在`CTView`的`drawRect:`方法中实现文本的绘制逻辑。首先,创建一个...