iOS 开发学习38 UIView嵌套UITableView
2015-06-24 16:17
579 查看
为了在UITableView里固定footer,在网上看到这样一段程序,但测试没起作用,这里仅作记录,以后理解了再回头来分析。
目前测试可行的方法是外面嵌套UIViewController,UITableViewController我没有找到直接固定footer的方法。
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat sectionFooterHeight = 40; CGFloat ButtomHeight = scrollView.contentSize.height - self.tableView.frame.size.height; if (ButtomHeight-sectionFooterHeight <= scrollView.contentOffset.y && scrollView.contentSize.height > 0) { scrollView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0); } else { scrollView.contentInset = UIEdgeInsetsMake(0, 0, -(sectionFooterHeight), 0); } }
目前测试可行的方法是外面嵌套UIViewController,UITableViewController我没有找到直接固定footer的方法。
#import <UIKit/UIKit.h> @interface WasherFunsViewController : UIViewController<UITableViewDelegate,UITableViewDataSource> @property (weak, nonatomic) IBOutlet UITableView *table; @end
#import "ViewController.h" @interface WasherFunsViewController () @end @implementation ViewController @synthesize table=_table; - (void)viewDidLoad { [super viewDidLoad]; _table.delegate=self; _table.dataSource=self; } ...其它代码省略...
相关文章推荐
- UItextfield 动态限制输入的字数
- Uva - 1612 - Guess
- Uva - 1612 - Guess
- iOS.UI.UIWindow
- LeetCode96:Unique Binary Search Trees
- 关于EL表达式中requestScope和param区别,el表达式与jstl标签
- .NET使用ueditor时不能上传图片的问题
- vbox uuid已存在
- quick-3.5 无法使用模拟器修改
- 黑马程序员——Java基础——continue、break、return之间的区别
- EasyUI常用控件的禁用方法
- UVa 11577 - Letter Frequency
- 单据UI代码开发
- primary key与unique的区别
- golang在32位系统下atomic.AddUint64导致程序崩溃及解决办法
- 设置父视图透明度子视图透明度也改变
- UIButton 如何设置为圆角矩形
- [SoapUI] UrlEncode编码/UrlDecode解码网站
- Android API Guides - Introduction
- 设置UITableView section间距