cbpowell / cppickerview Goto Github PK
View Code? Open in Web Editor NEWA custom, configurable, horizontal version of UIPickerView built to live in a UITableViewCell.
License: MIT License
A custom, configurable, horizontal version of UIPickerView built to live in a UITableViewCell.
License: MIT License
I had issues getting "scrollsToTop" to work properly in my app. What I found out is that only ONE view can have the "scrollsToTop" property set to true at any time for the app to scroll to the top when tapping the status bar.
To fix in your control, I added one line of code to the - (id)initWithFrame:(CGRect)frame method in CPPickerView.m
// content
...
self.contentView.scrollsToTop = NO;
...
Not sure if you needed this property in for another reason, but I believe the default value is YES, so setting it to no does the trick.
I'm trying to use the CPPickerView inside of a typical UITableView cell.
Inside the tableView data source, I have some code to create the cell:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath,
{
cell = [tableView dequeueReusableCellWithIdentifier:@"PickerCell"];
UILabel *lblName = (UILabel *)[cell viewWithTag:100];
lblName.text = [NSString stringWithString@"Name"];
CPPickerView *picker = [[CPPickerView alloc] initWithFrame:CGRectMake(197, 8, 112, 30)];
picker.itemFont = [UIFont boldSystemFontOfSize:14];
picker.dataSource = self;
picker.delegate = self;
[picker reloadData];
[cell addSubview:picker];
return cell;
}
When I run this code and it populates my table, I get the following error multiple times:
MyApp72404,0xac51f2c0) malloc: *** error for object 0xb51ad30: double free
*** set a breakpoint in malloc_error_break to debug
MyApp(72404,0xac51f2c0) malloc: *** error for object 0xb51ad30: double free
*** set a breakpoint in malloc_error_break to debug
MyApp(72404,0xac51f2c0) malloc: *** error for object 0xb51ad30: double free
*** set a breakpoint in malloc_error_break to debug
MyApp(72404,0xac51f2c0) malloc: *** error for object 0xb51ad30: double free
*** set a breakpoint in malloc_error_break to debug
I found out that if I comment out the following line, it works fine:
//picker.itemFont = [UIFont boldSystemFontOfSize:14];
I should note that I have disabled ARC for the CPPickerView class.
First, I really like this control!
I was in need for a compact hour/minutes selection, and the standard DatePicker cover half the screen....
But I noticed that as soon as I used the peekInset property, the area where the scrollView tracks the scrolling also gets smaller.
I do realize why, but it really compromises the usability, and basically makes the control annoying to use...
So I can't use the insets, and the GUI loses out on the visual hints that there are more data available...
Can You come up with a solution to make the whole pickerView sensitive for tracking even when we are using the peekInsets?
Add the control to a table view that scrolls, change the value, scroll it offscreen, and scroll it back onto the screen-- the view will be back to the item at index 0.
Hi there,
This is a really cool and easy to use horizontal picker view. Another useful feature would be conditional disabling of scrolling in the picker. For example, when certain conditions are true the value is automatically selected in the picker (which you can already do) and the picker becomes disabled or un-scrollable so the user cant change the values till those conditions remain true.
cheers,
Saad
I forgot about this one when I submitted the other two issues.
In -(void)tileViews:
label.textColor = RGBACOLOR(0.0, 0.0, 0.0, 0.75);
gives a warning: "Implicit declaration of function 'RGBACOLOR' is invalid in C99"
Of course this is just a warning and I'm not sure why my Target is set to use GNUC99 now, but regardless, I changed this line to
label.textColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.75];
which matches of [UIColor ] calls you made elsewhere.
when i used your cPPickerView in my table its shows black but when highlighte it it appears , when the highighted goes away ,, its return black ,, do u have any idea how to fix that !??
How about infinite menu?
If locate on last option, go to first menu.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.