星空网 > 软件开发 > 操作系统

ScrollView/ScrollViewDelegate

UIScrollView

 

1.contentOffset

/** 内容向外偏移,只在初始状态有效,拉拽后偏移量变回0*/

@property(nonatomic) CGPoint contentOffset

 

2.contentSize

/** 内容大小*/

@property(nonatomic) CGSize contentSize

 

3.contentInset

/** 内容向内偏移,一直有效*/

@property(nonatomic) UIEdgeInsets contentInset

 

4.scrollEnabled

/** 滚动可否*/

@property(nonatomic, getter=isScrollEnabled) BOOL scrollEnabled

 

5.directionLockEnabled

/** 是否支持同一时间垂直水平同时可拉拽,默认支持*/

@property(nonatomic, getter=isDirectionalLockEnabled) BOOL directionalLockEnabled

Discussion

If this property is NO, scrolling is permitted in both horizontal and vertical directions. If this property is YES and the user begins dragging in one general direction (horizontally or vertically), the scroll view disables scrolling in the other direction. If the drag direction is diagonal, then scrolling will not be locked and the user can drag in any direction until the drag completes. The default value is NO

 

6.pageEnabled

/** 滚动时最后会停在整数倍位置*/

@property(nonatomic, getter=isPagingEnabled) BOOL pagingEnabled

 

7.bounces

/** 遇到边界是否会碰撞返回,默认YES*/

@property(nonatomic) BOOL bounces

 

8.decelerationRate

/** 滚动后减速的速度*/

@property(nonatomic) CGFloat decelerationRate

Discussion

Your application can use the UIScrollViewDecelerationRateNormal and UIScrollViewDecelerationRateFast constants as reference points for reasonable deceleration rates.

 

9.tracking/dragging/decelerating

/** tracking发生在刚接触屏幕,dragging发生在拖拽时,decelerating发生在手松开后还滚动的时候*/

@property(nonatomic, readonly, getter=isTracking) BOOL tracking

@property(nonatomic, readonly, getter=isDragging) BOOL dragging

@property(nonatomic, readonly, getter=isDecelerating) BOOL decelerating

 

10.indicatorStyle

/** 滚动条Style*/

@property(nonatomic) UIScrollViewIndicatorStyle indicatorStyle

默认Default样式

typedef enum : NSInteger {

   UIScrollViewIndicatorStyleDefault,

   UIScrollViewIndicatorStyleBlack,

   UIScrollViewIndicatorStyleWhite 

} UIScrollViewIndicatorStyle;

 

11.scrollIndicatorInsets

/** 滚动条内嵌距离*/

@property(nonatomic) UIEdgeInsets scrollIndicatorInsets

 

12.showsHorizontalScrollIndicator/VerticalScrollIndicator

/** 是否显示滚动条*/

@property(nonatomic) BOOL showsHorizontalScrollIndicator

@property(nonatomic) BOOL showsVerticalScrollIndicator

 

13.flashScrollIndicators

/** 显示滚动条在最前面时调用*/

- (void)flashScrollIndicators

Discussion

You should call this method whenever you bring the scroll view to front.

 

14.delegate

/** 代理*/

@property(nonatomic, assign) id< UIScrollViewDelegate > delegate

Discussion

The delegate must adopt the UIScrollViewDelegate protocol. 

 

15.keyboardDismissMode

/** 键盘消失时间*/

@property(nonatomic) UIScrollViewKeyboardDismissMode keyboardDismissMode

默认None

typedef enum : NSInteger {

   UIScrollViewKeyboardDismissModeNone,

   UIScrollViewKeyboardDismissModeOnDrag,

   UIScrollViewKeyboardDismissModeInteractive 

}UIScrollViewKeyboardDismissMode;

 

UIScrollViewDelegate

 

1.Dragging and Scrolling

- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView

- (void)scrollViewDidScroll:(UIScrollView *)scrollView

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate

 

- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView

- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView

 

- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView

 

- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView

The scroll view calls this method at the end of its implementations of the setContentOffset:animated: and scrollRectToVisible:animated: methods, but only if animations are requested.

 

2.Zooming

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView

Return Value

A UIView object that will be scaled as a result of the zooming gesture. Return nil if you don’t want zooming to occur.

 

- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view

- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(CGFloat)scale

- (void)scrollViewDidZoom:(UIScrollView *)scrollView

 




原标题:ScrollView/ScrollViewDelegate

关键词:ie

ie
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

波兰第一站!Shopee拟迈入欧洲市场:https://www.kjdsnews.com/a/556674.html
旺季热门变侵权重灾区!大批卖家被起诉,多款产品暗藏危机:https://www.kjdsnews.com/a/556675.html
速卖通店铺3天销量破零运营技巧:https://www.kjdsnews.com/a/556676.html
eBay Fulfillment 澳洲仓试运营,为旺季助力:https://www.kjdsnews.com/a/556677.html
日销千单的运营技巧:利用视频营销提高产品转化率:https://www.kjdsnews.com/a/556678.html
Shopify供应商有哪些?怎么找Shopify供应商:https://www.kjdsnews.com/a/556679.html
珠海附近过年旅游景点 珠海附近过年旅游景点免费:https://www.vstour.cn/a/408243.html
韶关有组团到山西旅游 韶关到山西有多少公里:https://www.vstour.cn/a/408244.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流