You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

105 lines
5.1 KiB

/**
* Tencent is pleased to support the open source community by making QMUI_iOS available.
* Copyright (C) 2016-2020 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.
*/
//
// QMUIButton.h
// qmui
//
// Created by QMUI Team on 14-7-7.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 控制图片在UIButton里的位置,默认为QMUIButtonImagePositionLeft
typedef NS_ENUM(NSUInteger, QMUIButtonImagePosition) {
QMUIButtonImagePositionTop, // imageView在titleLabel上面
QMUIButtonImagePositionLeft, // imageView在titleLabel左边
QMUIButtonImagePositionBottom, // imageView在titleLabel下面
QMUIButtonImagePositionRight, // imageView在titleLabel右边
};
/**
*
* 1. tintColor UIButton tintColor
* 2. highlighteddisabled alpha来表现 state titleColorimagealpha ButtonHighlightedAlphaButtonDisabledAlpha
* 3. highlightedBackgroundColor
* 4. highlightedBorderColor
* 5. titleLabel imagePosition
* 6. titleLabel titleEdgeInestsimageEdgeInsetsspacingBetweenImageAndTitle
* @warning QMUIButton UIButton.titleEdgeInestsimageEdgeInsetscontentEdgeInsets sizeThatFits: titleEdgeInests imageEdgeInsets UIButton 使使
*/
@interface QMUIButton : UIButton
/**
* initWithXxx
*/
- (void)didInitialize NS_REQUIRES_SUPER;
/**
* tintColor调整titleColor是不跟随的<br/>
* NO
*/
@property(nonatomic, assign) IBInspectable BOOL adjustsTitleTintColorAutomatically;
/**
* tintColor调整image是需要更改renderingMode才可以达到这种效果<br/>
* NO
*/
@property(nonatomic, assign) IBInspectable BOOL adjustsImageTintColorAutomatically;
/**
* adjustsTitleTintColorAutomatically = YES & adjustsImageTintColorAutomatically = YES & tintColor = xxx
* @warning nil
*/
@property(nonatomic, strong) IBInspectable UIColor *tintColorAdjustsTitleAndImage;
/**
* highlighted时的按钮样式YES<br/>
* YES时highlighted时会改变自身的alpha属性为<b>ButtonHighlightedAlpha</b>
*/
@property(nonatomic, assign) IBInspectable BOOL adjustsButtonWhenHighlighted;
/**
* disabled时的按钮样式YES<br/>
* YES时disabled时会改变自身的alpha属性为<b>ButtonDisabledAlpha</b>
*/
@property(nonatomic, assign) IBInspectable BOOL adjustsButtonWhenDisabled;
/**
* nil
* @warning highlightedBackgroundColor时adjustsButtonWhenHighlighted设为NO
* @see adjustsButtonWhenHighlighted
*/
@property(nonatomic, strong, nullable) IBInspectable UIColor *highlightedBackgroundColor;
/**
* nil
* @warning highlightedBorderColor时adjustsButtonWhenHighlighted设为NO
* @see adjustsButtonWhenHighlighted
*/
@property(nonatomic, strong, nullable) IBInspectable UIColor *highlightedBorderColor;
/**
* QMUIButtonImagePositionLeft<br/>
* imageEdgeInsetstitleEdgeInsetscontentHorizontalAlignmentcontentVerticalAlignment使用
*/
@property(nonatomic, assign) QMUIButtonImagePosition imagePosition;
/**
* imagePosition 0<br/>
* titleEdgeInsets imageEdgeInsets contentEdgeInsets 使<br/>
* @warning imageEdgeInsets titleEdgeInsets contentEdgeInsets
*/
@property(nonatomic, assign) IBInspectable CGFloat spacingBetweenImageAndTitle;
@end
NS_ASSUME_NONNULL_END