UIScrollView(滑动视图)
2016-05-05 19:45
363 查看
UIScrollView
@interface UIScrollView : UIView//滑动条样式 @property(nonatomic)UIScrollViewIndicatorStyle indicatorStyle; // default is UIScrollViewIndicatorStyleDefault typedef NS_ENUM(NSInteger, UIScrollViewIndicatorStyle) { UIScrollViewIndicatorStyleDefault, // black with white border. good against any background UIScrollViewIndicatorStyleBlack, // black only. smaller. good against a white background UIScrollViewIndicatorStyleWhite // white only. smaller. good against a black background }; //边缘的反弹效果 @property(nonatomic)BOOL bounces; // default YES. //横滑动条是否显示 @property(nonatomic)BOOL showsHorizontalScrollIndicator; // default YES. //竖滑动条是否显示 @property(nonatomic)BOOL showsVerticalScrollIndicator; // default YES. //是否允许滑动 @property(nonatomic,getter=isScrollEnabled) BOOL scrollEnabled; // default YES. //是否允许滑动到顶部 @property(nonatomic)BOOL scrollsToTop; // default is YES. //一个方向滑动,另一个方向锁定 @property(nonatomic,getter=isDirectionalLockEnabled) BOOL directionalLockEnabled;// default NO. //显示视图的坐标 @property(nonatomic)CGPoint contentOffset; // default CGPointZero //内容视图的大小 @property(nonatomic)CGSize contentSize; //代理 @property(nullable,nonatomic,weak) id<UIScrollViewDelegate> delegate; //最大最小缩放比例 @property(nonatomic) CGFloat minimumZoomScale; // default is 1.0 @property(nonatomic) CGFloat maximumZoomScale; // default is 1.0.
@protocol UIScrollViewDelegate
//滑动完成 - (void)scrollViewDidScroll:(UIScrollView *)scrollView; // any offset changes //缩放完成后返回的视图 - (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView; // return a view that will be scaled. if delegate returns nil, nothing happens
通过方法设置缩放倍数
//设置缩放倍数和是否动画 - (void)setZoomScale:(CGFloat)scale animated:(BOOL)animated; //设置缩放范围 - (void)zoomToRect:(CGRect)rect animated:(BOOL)animated;
相关文章推荐
- -[UICachedDeviceRGBColor CGImage]: unrecognized selector sent to instance 0x130972b90
- UILabel 实现国际象棋棋盘界面
- APUE笔记:alarm和pause竞争
- UILabel 标签
- UILabel 实现计算器界面
- 导航栏上面添加UISearchBar pop回去的时候会把添加的导航栏带回去的问题
- Leetcode - Longest Increasing Subsequence
- SDUTOJ 2169 Sequence 山东省第二届省赛
- 问:GUI的蓝海在哪里?答:嵌入式!
- EntityFramework IEnumerable,IQueryable ,Include
- MiniUI 快速上手
- GCD介绍: 基本概念和Dispatch Queue
- 【动态规划】XMU 1583 Sequence
- warning C4800: “BOOL”: 将值强制为布尔值“true”或“false”(性能警告)
- 关于window.event.returnValue=false的用处
- Access restriction : The type BASE64Decoder is not accessible due to restriction
- @Responsebody与@RequestBody
- 还来一篇说下json_value 以及 json_query 的应用 (3)
- Moqui学习之数据与资源
- 【Arduino官方教程第一辑】示例程序 3-1 模拟信号与串口