下拉列表视图
重要提示:如果你的项目不使用 ARC:您必须将 -fobjc-arc
编译器标志添加到目标设置 > 编译阶段 > 编译源中的 HLLDropDownQuickView.m
。
HLLDropDownQuickView
文件夹拖到您的项目中。HLLDropDownQuickView.h
(请参阅 /HLLDropDownQuickViewDemo
中的示例 Xcode 项目)
[dropDownQuickView setSelectionOptions:options withTitles:titles];
例如:设置带加粗和斜体的组合样式
dropDownQuickView.titleBackgroundImage=[UIImage imageNamed:@"title_background"];
dropDownQuickView.titleFont=[UIFont systemFontOfSize:9];
dropDownQuickView.titleColor=[UIColor redColor];
CGRect frame=dropDownQuickView.titleLabel.frame;
dropDownQuickView.titleLabel.frame=CGRectMake(10, frame.origin.y, frame.size.width, frame.size.height);
dropDownQuickView.optionBackgroundImage=[UIImage imageNamed:@"option_background"];
dropDownQuickView.optionFont=[UIFont systemFontOfSize:9];
dropDownQuickView.optionColor=[UIColor brownColor];
dropDownQuickView.title = @"USD";
使用 HLLDropDownQuickViewDelegate
@protocol HLLDropDownQuickViewDelegate <NSObject>
// Selection contains the user selected option or nil if nothing was selected
- (void)dropDownControlView:(HLLDropDownQuickView *)view didFinishWithSelection:(id)selection;
@optional
// You can use this to disable scrolling on a tableView
- (void)dropDownControlViewWillBecomeActive:(HLLDropDownQuickView *)view;
@end