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.

83 lines
3.8 KiB

2 years ago
/**
* 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.
*/
//
// UIScrollView+QMUI.h
// qmui
//
// Created by QMUI Team on 15/7/20.
//
#import <UIKit/UIKit.h>
@interface UIScrollView (QMUI)
/// 判断UIScrollView是否已经处于顶部(当UIScrollView内容不够多不可滚动时,也认为是在顶部)
@property(nonatomic, assign, readonly) BOOL qmui_alreadyAtTop;
/// 判断UIScrollView是否已经处于底部(当UIScrollView内容不够多不可滚动时,也认为是在底部)
@property(nonatomic, assign, readonly) BOOL qmui_alreadyAtBottom;
/// UIScrollView 的真正 inset,在 iOS11 以后需要用到 adjustedContentInset 而在 iOS11 以前只需要用 contentInset
@property(nonatomic, assign, readonly) UIEdgeInsets qmui_contentInset;
/**
UIScrollView contentInset contentInset scrollIndicatorInsets qmui_scrollToTopUponContentInsetTopChange contentOffset UIScrollViewContentInsetAdjustmentNever
@warning scrollView viewController viewController viewDidAppear viewDidAppear viewDidAppear viewController qmui_initialContentInset scrollView contentInset
*/
@property(nonatomic, assign) UIEdgeInsets qmui_initialContentInset;
/**
* scrollView内容是否足够滚动
* @warning <i>scrollEnabled</i>
*/
- (BOOL)qmui_canScroll;
/**
* scrollView是否可滚动
* @param force [self qmui_canScroll]
* @param animated
*/
- (void)qmui_scrollToTopForce:(BOOL)force animated:(BOOL)animated;
/**
* [self qmui_scrollToTopForce:NO animated:animated]
*/
- (void)qmui_scrollToTopAnimated:(BOOL)animated;
/// 等同于[self qmui_scrollToTopAnimated:NO]
- (void)qmui_scrollToTop;
/**
contentInset.top UIScrollViewContentInsetAdjustmentNever scrollView contentInset
*/
- (void)qmui_scrollToTopUponContentInsetTopChange;
/**
* scrollView可滚动
* @param animated
* @see [UIScrollView qmui_canScroll]
*/
- (void)qmui_scrollToBottomAnimated:(BOOL)animated;
/// 等同于[self qmui_scrollToBottomAnimated:NO]
- (void)qmui_scrollToBottom;
// 立即停止滚动,用于那种手指已经离开屏幕但列表还在滚动的情况。
- (void)qmui_stopDeceleratingIfNeeded;
/**
contentInset
@param contentInset contentInset
@param animated 使
*/
- (void)qmui_setContentInset:(UIEdgeInsets)contentInset animated:(BOOL)animated;
@end