scrollview不能滚动
1. 图片视图上不能直接滚动,需要设置交互属性为YES
_contentView = [[UIImageView alloc]initWithFrame:CGRectMake(0, _headerView.bottom, kDeviceWidth, kDeviceHeight-20-44-49-_headerView.height-kFooterViewHeight)];
_contentView.backgroundColor = [UIColor cyanColor]; _contentView.userInteractionEnabled = YES; [self addSubview:_contentView];
2.contentSize 这个属性,比uiscrollview的frame要小, 无需滚动, 自然就滚动不了。
3.scrollenabled 这个属性,标识着是否允许滚动,要言设成yes
4.因为AutoLayout的影响 -(void)viewDidLayoutSubviews { self.scrollView.contentSize = CGSizeMake(712,1000); }
另外还有一些比较隐蔽的原因. 如果这个scrollView是在IB里面生成的话,还得手动设置它的contentSize,并且不能在initWithNibName:bundle:里面设置,因为The nib file you specify is not loaded right away. It is loaded the first time the view controller’s view is accessed. If you want to perform additional initialization after the nib file is loaded, override theviewDidLoad method and perform your tasks there.
scrollview不能滚动的更多相关文章
- 触摸点为scrollview上的子控件时,scrollview不能滚动(iOS8)
现象:在iOS8上,scrollview上面布局了多行多列的button,滑动scrollview,如果当触摸点是在按钮上,scrollview不能滚动. 例如: 解决方法:设置scrollview的 ...
- 解决scrollview不滚动
scrollView不滚动的时候 试试这个,有时候药到病除:
- 封装scrollView 循环滚动,tableViewCell(连载) mvc
封装 封装 封装 ... 封装的重要性太重要了 给大家在送点干货 从一个项目中抽取出来的.和大家一起分享 封装scrollView 循环滚动.tableViewCell(连载) 明天还会更新 tabl ...
- 监视scrollview是否滚动到底
//监视scrollview是否滚动到底 - (void)scrollViewDidScroll:(UIScrollView *)scrollView{ [refreshHeaderViewegoRe ...
- ScrollView垂直滚动控件
ScrollView垂直滚动控件 一.简介 二.方法 1)ScrollView垂直滚动控件使用方法 1.在layout布局文件的最外层建立一个ScrollView控件 2.在ScrollView控件中 ...
- 完美解决EditText和ScrollView的滚动冲突(上)
在网上搜了一下EditText和ScrollView的滚动冲突,发现差点儿全部的解决方式都是触摸EditText的时候就将事件交由EditText处理,否则才将事件交由ScrollView处理.这样确 ...
- 屏蔽scrollview的滚动
外层有scrollview时,手指移动方向跟滚动条方向相同时,会导致scrollview的滚动.此时如果不想滚动的话,可以在要接受ontouch的子视图,或者子子视图中的touch监听里加上v.get ...
- 判断scrollview是否滚动到了底部
调用函数判断如下:if(getScrollY() + getHeight() >= computeVerticalScrollRange()){ Log.d(TAG," ...
- 解决点击状态栏时ScrollView自动滚动到初始位置失效办法
http://www.cocoachina.com/ios/20150807/12949.html 取消点击状态栏scrollView会自动滚动到初始位置的功能 _scrollView.scrolls ...
- android禁止ScrollView自动滚动
当Scrollview嵌套listview,或者子View的内容过多时,当内容加载完成后,ScrollView中内容的长度会发生改变,ScrollView会自动往下滚动,解决办法:在ScollView ...
随机推荐
- bootstrap-paginator 分页控件的使用
首先对js和css的引用 <link rel="stylesheet" href="reference/bootstrap/css/bootstrap.min.cs ...
- 【干货】.NET开发通用组件发布(四) 日志记录组件
组件介绍和合作开发 http://www.cnblogs.com/MrHuo/p/MrHuoControls.html 日志记录组件功能介绍 通过基类Logger,实现了文本记录日志和数据库记录日志两 ...
- CSS3 transition 动画过度属性
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:100px; back ...
- Makefile的几个赋值运算符(转:笔记)
http://www.cnblogs.com/pengdonglin137/p/3801060.html 在Makefile中我们经常看到 = := ?= +=这几个赋值运算符,那么他们有什么区别呢? ...
- 获取url 参数
epresssjs 里面请求参数,4.x 里面有3种方法 1.req.params app.get('user/:id',function(req,res){ res.send('user',req. ...
- LDD命令--可执行文件依赖的库出现错误时
http://littlepig3056.blog.163.com/blog/static/180758353201212751814134/ ldd 查看可执行文件依赖的库,结果会列出依赖的库名及 ...
- cf486C Palindrome Transformation
C. Palindrome Transformation time limit per test 1 second memory limit per test 256 megabytes input ...
- linux下tcpdump命令详解
简介 用简单的话来定义tcpdump,就是:dump the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具. tcpdump可以将网络中传送的数据包的 ...
- UESTC_敢说就敢做 CDOJ 631
敢说就敢做 Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others) Submit Sta ...
- Dungeon Game 解答
Question The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a ...