Comments (2)
You need to implement a custom scrolling with a UITableView
, which is always a pain and it won't feel native anyways.
I prefer to use UITableViewController
in 99.9% of cases, here's how you can implement a toolbar with UITableViewController
:
@interface ViewController
@property (strong, readwrite, nonatomic) UIView *topView;
@end
- (void)viewDidLoad
{
[super viewDidLoad];
self.topView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 100)];
self.topView.backgroundColor = [UIColor redColor];
self.tableView.contentInset = UIEdgeInsetsMake(100, 0, 0, 0);
self.tableView.scrollIndicatorInsets = self.tableView.contentInset;
[self.view addSubview:self.topView];
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGRect frame = self.topView.frame;
frame.origin.y = scrollView.contentOffset.y;
self.topView.frame = frame;
[scrollView bringSubviewToFront:self.topView];
}
and a bottom bar:
- (void)viewDidLoad
{
self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 144, 320, 100)]; // 144: 100 + navigationbar height
self.bottomView.backgroundColor = [UIColor redColor];
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0); // Adjust content inset to accommodate bottom edge inset
self.tableView.scrollIndicatorInsets = self.tableView.contentInset;
[self.view addSubview:self.bottomView];
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGRect frame = self.bottomView.frame;
frame.origin.y = scrollView.contentOffset.y + scrollView.frame.size.height - 100; // Move view to the bottom on scroll
self.bottomView.frame = frame;
[scrollView bringSubviewToFront:self.bottomView];
}
from retableviewmanager.
Thanks for sharing :). Works perfect!
from retableviewmanager.
Related Issues (20)
- UIReturnKeyDone is not firing an event HOT 1
- [Cocoapods] Archive failed with error: image file has vanished HOT 2
- Setting keyboardType as UIKeyboardTypePhonePad for RENumberItem does not work.
- More maintainers HOT 1
- placeholderLabel of RETableViewLongTextCell
- big data
- "RETableViewManager.bundle" not found. HOT 1
- How to get callback for each text entered in RETextItem so that we can process on that text HOT 2
- Inconsistent margins on devices wider than iPhone 4 HOT 6
- 1.7 bug
- Version 1.7 crashes with iOS7.
- Text color
- Somebody in?
- I want minuteInterval > 30 in RETableViewItem
- RENumberItem format don't work
- How can change align of text field
- itemWithImageNamed don't show image , also custom item & cell HOT 4
- Section text Color and Cell background color?
- build error in Xcode8.2.1 HOT 1
- Missing NSBundle+RETableViewManager.h file not found error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retableviewmanager.