cdts/xdts-ios 3/TreeHole/CYHResetCode/CYH/QMUIKit/QMUIComponents/QMUILabel.h

55 lines
2.5 KiB
C
Raw Permalink Normal View History

2023-07-27 09:20:00 +08:00
/**
* Tencent is pleased to support the open source community by making QMUI_iOS available.
* Copyright (C) 2016-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/MIT
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
//
// QMUILabel.h
// qmui
//
// Created by QMUI Team on 14-7-3.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/**
* `QMUILabel``contentEdgeInsets`padding的效果
*
* `canPerformCopyAction``YES` item menuItemTitleForCopyAction label的背景色默认为`highlightedBackgroundColor`
*/
@interface QMUILabel : UILabel
/// 控制label内容的padding默认为UIEdgeInsetsZero
@property(nonatomic,assign) UIEdgeInsets contentEdgeInsets;
/// 支持在 label 无法显示完整文字时在 label 的末尾显示一个自定义的 View通常用来实现点击展开更多的交互
@property(nonatomic, strong, nullable) __kindof UIView *truncatingTailView;
/// 是否需要长按复制的功能,默认为 NO。
/// 长按时的背景色通过`highlightedBackgroundColor`设置。
@property(nonatomic,assign) IBInspectable BOOL canPerformCopyAction;
/// 当 canPerformCopyAction 开启时,长按出来的菜单上的复制按钮的文本,默认为 nilnil 时 menuItem 上的文字为“复制”
@property(nonatomic, copy, nullable) IBInspectable NSString *menuItemTitleForCopyAction;
/**
label highlighted
1. canPerformCopyAction
2. subviews UITableViewCell cell highlighted label highlighted
nil
*/
@property(nonatomic,strong, nullable) IBInspectable UIColor *highlightedBackgroundColor UI_APPEARANCE_SELECTOR;
/// 点击了“复制”后的回调
@property(nonatomic, copy, nullable) void (^didCopyBlock)(QMUILabel *label, NSString *stringCopied);
@end
NS_ASSUME_NONNULL_END