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

54 lines
2.4 KiB
C
Raw 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.
*/
//
// QMUIPopupMenuButtonItem.h
// QMUIKit
//
// Created by QMUI Team on 2018/8/21.
//
#import "QMUIPopupMenuBaseItem.h"
NS_ASSUME_NONNULL_BEGIN
@class QMUIButton;
/**
* QMUIPopupMenuView 使
*
* QMUIPopupMenuView QMUIPopupMenuButtonItem.button view
*/
@interface QMUIPopupMenuButtonItem : QMUIPopupMenuBaseItem
/// item 里的图片,默认在左边,也可通过 item.button.imagePosition 修改图片的位置
@property(nonatomic, strong, nullable) UIImage *image;
/// 每个 item 都通过一个 button 来显示内容,可直接修改 button 的相关属性达到自定义的效果button 的 tintColor 为 nil因此可以自动响应 QMUIPopupMenuView 的 tintColor 变化。
@property(nonatomic, strong, readonly, nonnull) QMUIButton *button;
/// item 被点击时的背景色,默认为 TableViewCellSelectedBackgroundColor与列表的 cell 点击背景色一致。
@property(nonatomic, strong, nullable) UIColor *highlightedBackgroundColor UI_APPEARANCE_SELECTOR;
/// item 里图片和文字之间的间距,默认为 6只有同时存在图片和文字时这个属性才会生效。
@property(nonatomic, assign) CGFloat imageMarginRight UI_APPEARANCE_SELECTOR;
/**
@param image item
@param title item
@param handler item aMenuView
@return item
*/
+ (instancetype)itemWithImage:(nullable UIImage *)image title:(nullable NSString *)title handler:(nullable void (^)(__kindof QMUIPopupMenuButtonItem *aItem))handler;
@end
NS_ASSUME_NONNULL_END