ios 中没有下拉组件,下面是自己实现的分享给大家!
//
// CloCombox.h
// ColCombox
//
// Created by cloay on 12-11-12.
// Copyright (c) 2012年 topgether. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol CloComboxDelegate;
@interface CloCombox : UIView <UITableViewDataSource, UITableViewDelegate>{
UIButton *title;
UITableView *cloTable;
}
@property (nonatomic, retain) id <CloComboxDelegate> delegate;
@property (nonatomic, retain) NSArray *tableItems;
- (void)setTitle:(NSString *)titleStr;
- (id)initWithFrame:(CGRect)frame items:(NSArray *)items inView:(UIView *)view;
@end
@protocol CloComboxDelegate <NSObject>
- (void)itemDidSelected:(NSInteger)index;
@end
实现:
//
// CloCombox.m
// ColCombox
//
// Created by cloay on 12-11-12.
// Copyright (c) 2012年 topgether. All rights reserved.
//
#import "Clo