| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A custom text field with drop-down support.
CHDropDownTextField is available through CocoaPods, to install it simply add the following line to your Podfile:
pod "CHDropDownTextField"
To install manually, just copy everything in the CHDropDownTextField directory into your Xcode project.
Important: If your project doesn't use ARC you must add the -fobjc-arc compiler flag to all CHCircleGaugeView implementation files in Target Settings > Build Phases > Compile Sources.
Custom Cells
The default cell is not flexible at all. If you wish to customize the style of the cells you need to create a custom cell subclass and set the cellClass:
self.dropDownTextField.cellClass = [MyCustomTableViewCell class];
Warning: The text field will still use the native textLabel and detailTextLabel.
Subtitles
The default drop-down cells support subtitles by default (using UITableViewCellStyleValue1 style). To show subtitles you just need to set the dropDownTableSubtitlesArray property to an array of strings with the same amount of strings as the dropDownTableTitlesArray, otherwise the subtitles won't show.
If you choose to use a custom cell, your custom cell subclass should override initWithStyle:reuseIdentifier: and call super by enforcing a style. For example;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
return [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
}
Styling
Feel free to customize the text field's dropDownTableView as you wish with a few exceptions:
Pull request are welcomed. To add functionality or to make changes:
Created by Osama Ashawa, Matthew Morey, Rogelio Gudino, and other contributors.
CHDropDownTextField is available under the MIT license. See the LICENSE file for more information. If you're using CHDropDownTextField in your project, attribution would be nice.
| Back | FazBrowse Home | New Git URL |