QMUIMoreOperationController
@interface QMUIMoreOperationController
: UIViewController <QMUIModalPresentationContentViewControllerProtocol,
QMUIModalPresentationViewControllerDelegate,
QMUIModalPresentationComponentProtocol>
更多操作面板控件,类似系统的相册分享面板,以及微信的 webview 分享面板。功能特性包括:
- 支持多行,每行支持多个 item,由二维数组 items 控制。
- 默认自带取消按钮,也可自行隐藏。
- 支持以 UIAppearance 的方式配置样式皮肤。
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIColor *contentBackgroundColor
Swift
var contentBackgroundColor: UIColor? { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) UIEdgeInsets contentEdgeMargins
Swift
var contentEdgeMargins: UIEdgeInsets { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) CGFloat contentMaximumWidth
Swift
var contentMaximumWidth: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) CGFloat contentCornerRadius
Swift
var contentCornerRadius: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) UIEdgeInsets contentPaddings
Swift
var contentPaddings: UIEdgeInsets { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIColor *scrollViewSeparatorColor
Swift
var scrollViewSeparatorColor: UIColor? { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) UIEdgeInsets scrollViewContentInsets
Swift
var scrollViewContentInsets: UIEdgeInsets { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIColor *itemBackgroundColor
Swift
var itemBackgroundColor: UIColor? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIColor *itemTitleColor
Swift
var itemTitleColor: UIColor? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIFont *itemTitleFont
Swift
var itemTitleFont: UIFont? { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) CGFloat itemPaddingHorizontal
Swift
var itemPaddingHorizontal: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) CGFloat itemTitleMarginTop
Swift
var itemTitleMarginTop: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) CGFloat itemMinimumMarginHorizontal
Swift
var itemMinimumMarginHorizontal: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) BOOL automaticallyAdjustItemMargins
Swift
var automaticallyAdjustItemMargins: Bool { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIColor *cancelButtonBackgroundColor
Swift
var cancelButtonBackgroundColor: UIColor? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIColor *cancelButtonTitleColor
Swift
var cancelButtonTitleColor: UIColor? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIColor *cancelButtonSeparatorColor
Swift
var cancelButtonSeparatorColor: UIColor? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong) UIFont *cancelButtonFont
Swift
var cancelButtonFont: UIFont? { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) CGFloat cancelButtonHeight
Swift
var cancelButtonHeight: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign) CGFloat cancelButtonMarginTop
Swift
var cancelButtonMarginTop: CGFloat { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, weak) id<QMUIMoreOperationControllerDelegate> delegate
Swift
weak var delegate: QMUIMoreOperationControllerDelegate? { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) UIView *contentView
Swift
var contentView: UIView? { get }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy, readonly) NSArray<UIScrollView *> *scrollViews
Swift
var scrollViews: [UIScrollView]? { get }
-
取消按钮,如果不需要,则自行设置其 hidden 为 YES
Declaration
Objective-C
@property(nullable, nonatomic, strong, readonly) QMUIButton *cancelButton
Swift
var cancelButton: UIButton? { get }
-
在 iPhoneX 机器上是否延伸底部背景色。因为在 iPhoneX 上我们会把整个面板往上移动 safeArea 的距离,如果你的面板本来就配置成撑满全屏的样式,那么就会露出底部的空隙,isExtendBottomLayout 可以帮助你把空暇填补上。默认为NO。
Declaration
Objective-C
@property (nonatomic) BOOL isExtendBottomLayout;
Swift
var isExtendBottomLayout: Bool { get set }
-
Undocumented
Declaration
Objective-C
@property(nullable, nonatomic, copy) NSArray<NSArray<QMUIMoreOperationItemView *> *> *items
Swift
var items: [[QMUIMoreOperationItemView]]? { get set }
-
添加一个 itemView 到指定 section 的末尾
Declaration
Objective-C
- (void)addItemView:(nonnull QMUIMoreOperationItemView *)itemView inSection:(NSInteger)section;
Swift
func add(_ itemView: QMUIMoreOperationItemView, inSection section: Int)
-
插入一个 itemView 到指定的位置,NSIndexPath 请使用 section-item 组合,其中 section 表示行,item 表示 section 里的元素序号
Declaration
Objective-C
- (void)insertItemView:(nonnull QMUIMoreOperationItemView *)itemView atIndexPath:(nonnull NSIndexPath *)indexPath;
Swift
func insert(_ itemView: QMUIMoreOperationItemView, at indexPath: IndexPath)
-
移除指定位置的 itemView,NSIndexPath 请使用 section-item 组合,其中 section 表示行,item 表示 section 里的元素序号
Declaration
Objective-C
- (void)removeItemViewAtIndexPath:(nonnull NSIndexPath *)indexPath;
Swift
func removeItemView(at indexPath: IndexPath)
-
获取指定 tag 的 itemView,如果不存在则返回 nil
Declaration
Objective-C
- (QMUIMoreOperationItemView *_Nullable)itemViewWithTag:(NSInteger)tag;
Swift
func itemView(withTag tag: Int) -> QMUIMoreOperationItemView?
-
获取指定 itemView 在当前控件里的 indexPath,如果不存在则返回 nil
Declaration
Objective-C
- (NSIndexPath *_Nullable)indexPathWithItemView: (nonnull QMUIMoreOperationItemView *)itemView;
Swift
func indexPath(with itemView: QMUIMoreOperationItemView) -> IndexPath?
-
弹出面板,一般在 init 完并且设置好 items 之后就调用这个接口来显示面板
Declaration
Objective-C
- (void)showFromBottom;
Swift
func showFromBottom()
-
隐藏面板
Declaration
Objective-C
- (void)hideToBottom;
Swift
func hideToBottom()
-
更多操作面板是否正在显示
Declaration
Objective-C
@property (nonatomic, readonly, getter=isShowing) BOOL showing;
Swift
var isShowing: Bool { get }
-
Undocumented
Declaration
Objective-C
@property(nonatomic, assign, getter=isAnimating, readonly) BOOL animating
Swift
var isAnimating: Bool { get }
-
Undocumented
Declaration
Objective-C
+ (instancetype)appearance;
Swift
class func appearance() -> Self