Latest | 0.0.3 |
---|---|
Homepage | https://github.com/Nihility-Ming/CNCityPickerView |
License | MIT |
Platforms | ios 7.0 |
Authors |
A support of Interface Builder and code to create custom very high level Chinese City Selector.
Usage
Written code.
// 使用代码的方式添加也行
CGRect pickerViewFrame = CGRectMake(0, self.view.bounds.size.height-180, self.view.bounds.size.width, 180);
// 1、创建
CNCityPickerView *pickerView = [CNCityPickerView createPickerViewWithFrame:pickerViewFrame valueChangedCallback:^(NSString *province, NSString *city, NSString *area) {
_displayLabel.text = [NSString stringWithFormat:@"%@ %@ %@", province, city, area];
}];
// 2、可选设置的属性
pickerView.textAttributes = @{NSForegroundColorAttributeName : [UIColor redColor],
NSFontAttributeName : [UIFont boldSystemFontOfSize:18.0f]
};
pickerView.rowHeight = 30.0f;
// 3、添加到指定视图
[self.view addSubview:pickerView];
Use Interface Builder.
// 直接拖IB也行哦
__weak UILabel *displayLabel = _displayLabel;
[_cityPickerView setValueChangedCallback:^(NSString *province, NSString *city, NSString *area) {
displayLabel.text = [NSString stringWithFormat:@"%@ %@ %@", province, city, area];
}];
Installation
pod 'CNCityPickerView'
All you need to do is drop CNCityPickerView
files into your project, and add #include "CNCityPickerView.h"
to the top of classes that will use it.
License
CNCityPickerView is available under the MIT license.
Latest podspec
{ "name": "CNCityPickerView", "version": "0.0.3", "summary": "A support of IB and code to create Chinese City Selector.", "description": "1u3001Support Interface Builder.n2u3001Support custom very high level.n", "homepage": "https://github.com/Nihility-Ming/CNCityPickerView", "license": "MIT", "authors": { "Bi Weiming": "[email protected]" }, "platforms": { "ios": "7.0" }, "source": { "git": "https://github.com/Nihility-Ming/CNCityPickerView.git", "tag": "0.0.3" }, "source_files": [ "CNCityPickerViewExample/CNCityPickerView/*", "CNCityPickerViewExample/CNCityPickerView/Classes/*" ] }
Sun, 06 Mar 2016 00:21:04 +0000