UIPickerView、datePicker练习 -- 自定义textField样式
Main.storyboard
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="vXZ-lx-hvc"> <dependencies> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/> </dependencies> <scenes> <!--View Controller--> <scene sceneID="ufC-wZ-h7g"> <objects> <viewController id="vXZ-lx-hvc" customClass="LWTViewController" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="kh9-bI-dsS"> <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <subviews> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="姓 名" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="rh6-nf-4cX"> <rect key="frame" x="20" y="28" width="54" height="21"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="手机号" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Afe-zY-ocr"> <rect key="frame" x="20" y="70" width="54" height="21"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="地 址" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gJk-Cc-7CD"> <rect key="frame" x="20" y="154" width="54" height="21"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="生 日" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="80U-K4-FTw"> <rect key="frame" x="20" y="111" width="54" height="21"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="bzo-Na-Zf3"> <rect key="frame" x="101" y="24" width="199" height="30"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> </textField> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="AOF-I4-AtV"> <rect key="frame" x="101" y="66" width="199" height="30"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> </textField> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="dS4-WE-vY0"> <rect key="frame" x="101" y="108" width="199" height="30"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> </textField> <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" id="Zfg-sm-mqV"> <rect key="frame" x="101" y="150" width="199" height="30"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" pointSize="14"/> <textInputTraits key="textInputTraits"/> </textField> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> </view> <connections> <outlet property="inputBirthdayTextField" destination="dS4-WE-vY0" id="joI-w9-SBc"/> <outlet property="inputMobileTextField" destination="AOF-I4-AtV" id="zXj-Fq-BRd"/> <outlet property="inputNametextfield" destination="bzo-Na-Zf3" id="6ph-ho-bwg"/> <outlet property="inputaddressTextField" destination="Zfg-sm-mqV" id="f2a-2G-ywv"/> </connections> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/> </objects> </scene> </scenes> <simulatedMetricsContainer key="defaultSimulatedMetrics"> <simulatedStatusBarMetrics key="statusBar"/> <simulatedOrientationMetrics key="orientation"/> <simulatedScreenMetrics key="destination"/> </simulatedMetricsContainer> </document>
LWTViewController.h
#import <UIKit/UIKit.h> @interface LWTViewController : UIViewController @end
LWTViewController.m
1 // 2 // LWTViewController.m 3 // datePicker练习 -- 自定义textField样式 4 // 5 // Created by apple on 14-6-5. 6 // Copyright (c) 2014年 lwt. All rights reserved. 7 // 8 9 #import "LWTViewController.h" 10 #import "LWTCityModel.h" 11 12 @interface LWTViewController () <UIPickerViewDataSource, UIPickerViewDelegate, UITextFieldDelegate> 13 /** 14 * 姓名键盘 15 */ 16 @property (weak, nonatomic) IBOutlet UITextField *inputNametextfield; 17 /** 18 * 手机键盘 19 */ 20 @property (weak, nonatomic) IBOutlet UITextField *inputMobileTextField; 21 /** 22 * 生日键盘 23 */ 24 @property (weak, nonatomic) IBOutlet UITextField *inputBirthdayTextField; 25 /** 26 * 地址键盘 27 */ 28 @property (weak, nonatomic) IBOutlet UITextField *inputaddressTextField; 29 /** 30 * 保存当前键盘第一响应者 31 */ 32 @property (weak, nonatomic) IBOutlet UITextField *inputNowTextField; 33 /** 34 * 用数组保存所有的键盘 35 */ 36 @property (nonatomic, strong) NSArray *textFieldArray; 37 /** 38 * 上一个按钮 39 */ 40 @property (nonatomic, weak) UIBarButtonItem *previousBtn; 41 /** 42 * 下一个按钮 43 */ 44 @property (nonatomic, weak) UIBarButtonItem *nextBtn; 45 46 // 保存城市模型 47 @property (nonatomic, strong) NSArray *cities; 48 // 保存城市 49 @property (nonatomic, strong) NSArray *tempArray; 50 51 @end 52 53 @implementation LWTViewController 54 55 #pragma mark - 懒加载 56 - (NSArray *)cities 57 { 58 if (nil == _cities) { 59 NSString *path = [[NSBundle mainBundle] pathForResource:@"cities.plist" ofType:nil]; 60 NSArray *citiesArray = [NSArray arrayWithContentsOfFile:path]; 61 62 NSMutableArray *models = [NSMutableArray arrayWithCapacity:citiesArray.count]; 63 64 for (NSDictionary *dict in citiesArray) { 65 LWTCityModel *cities = [LWTCityModel cityWithDict:dict]; 66 [models addObject:cities]; 67 } 68 _cities = models; 69 } 70 return _cities; 71 } 72 73 - (void)viewDidLoad 74 { 75 [super viewDidLoad]; 76 // Do any additional setup after loading the view, typically from a nib. 77 // 创建工具条 78 UIToolbar *toolbar = [[UIToolbar alloc] init]; 79 toolbar.barTintColor = [UIColor cyanColor]; 80 toolbar.frame = CGRectMake(0, 0, 320, 44); 81 82 // 设置添加按钮 83 UIBarButtonItem *item0 = [[UIBarButtonItem alloc] initWithTitle:@"上一个" style: UIBarButtonItemStylePlain target:self action:@selector(previousBtnClick:)]; 84 self.previousBtn = item0; 85 UIBarButtonItem *item1 = [[UIBarButtonItem alloc] initWithTitle:@"下一个" style: UIBarButtonItemStylePlain target:self action:@selector(nextBtnClick:)]; 86 self.nextBtn = item1; 87 UIBarButtonItem *item2 = [[UIBarButtonItem alloc] initWithTitle:@"完成" style: UIBarButtonItemStylePlain target:self action:@selector(finish)]; 88 UIBarButtonItem *item3 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]; 89 90 // 给工具条添加按钮 91 toolbar.items = @[item0, item1, item3, item2]; 92 93 // 设置文本输入框键盘的辅助视图 94 self.inputNametextfield.inputAccessoryView = toolbar; 95 self.inputMobileTextField.inputAccessoryView = toolbar; 96 self.inputBirthdayTextField.inputAccessoryView = toolbar; 97 self.inputaddressTextField.inputAccessoryView = toolbar; 98 99 // 设置手机文本输入框样式为数字键盘 100 self.inputMobileTextField.keyboardType = UIKeyboardTypeNumberPad; 101 102 // 创建时间选择器 103 UIDatePicker *datePicker = [[UIDatePicker alloc] init]; 104 // 设置日期为中文 105 datePicker.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; 106 // 设置只显示日期 107 datePicker.datePickerMode = UIDatePickerModeDate; 108 // 设置监听事件 109 [datePicker addTarget:self action:@selector(run:) forControlEvents:UIControlEventValueChanged]; 110 // 设置生日键盘文本输入框的自定义键盘为时间选择器 111 self.inputBirthdayTextField.inputView = datePicker; 112 // 设置初始值 113 [self run:datePicker]; 114 115 // 设置键盘代理 116 self.inputNametextfield.delegate = self; 117 self.inputMobileTextField.delegate = self; 118 self.inputBirthdayTextField.delegate = self; 119 self.inputaddressTextField.delegate = self; 120 121 // 用数组保存所有键盘 122 self.textFieldArray = @[self.inputNametextfield, self.inputMobileTextField, self.inputBirthdayTextField, self.inputaddressTextField]; 123 124 // 创建pickerview 125 UIPickerView *pickView = [[UIPickerView alloc] init]; 126 pickView.dataSource = self; 127 pickView.delegate = self; 128 129 // 设置地址键盘文本输入框的自定义键盘为pickerView 130 self.inputaddressTextField.inputView = pickView; 131 132 // 设置初始值 133 [self pickerView:nil didSelectRow:0 inComponent:0]; 134 135 } 136 137 #pragma mark - 键盘的辅助视图按钮监听功能 138 // 监听点击上一个按钮事件 139 - (void)previousBtnClick: (UIButton *) btn 140 { 141 NSInteger key = [self.textFieldArray indexOfObject:self.inputNowTextField]; 142 [self.textFieldArray[--key] becomeFirstResponder]; 143 } 144 // 监听点击下一个按钮事件 145 - (void)nextBtnClick: (UIButton *)btn 146 { 147 NSInteger key = [self.textFieldArray indexOfObject:self.inputNowTextField]; 148 [self.textFieldArray[++key] becomeFirstResponder]; 149 } 150 // 隐藏键盘 151 - (void)finish 152 { 153 [self.view endEditing:YES]; 154 } 155 156 #pragma mark - 获取键盘第一响应者 157 // 获取键盘第一响应者 158 - (void)textFieldDidBeginEditing:(UITextField *)textField 159 { 160 self.inputNowTextField =textField; 161 NSInteger key = [self.textFieldArray indexOfObject:self.inputNowTextField]; 162 self.nextBtn.enabled = YES; 163 self.previousBtn.enabled = YES; 164 if (key == 0) { 165 self.previousBtn.enabled = NO; 166 167 }else if (key == self.textFieldArray.count - 1) 168 { 169 self.nextBtn.enabled = NO; 170 } 171 } 172 #pragma mark - 监听时间选择器 173 // 监听时间选择器,获取选择时间 174 - (void)run : (UIDatePicker *)datePicker 175 { 176 NSDate *date = datePicker.date; 177 NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 178 formatter.dateFormat = @"yyyy-MM-dd"; 179 self.inputBirthdayTextField.text = [formatter stringFromDate:date]; 180 } 181 182 #pragma mark - citiesPickerView 的 UIPickerViewDataSource 183 // 列数 184 - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 185 { 186 return 2; 187 } 188 // 行数 189 - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component 190 { 191 if (0 == component) { 192 // 省份列 193 return self.cities.count; 194 }else 195 { 196 // 城市列 197 return self.tempArray.count; 198 } 199 } 200 201 #pragma mark - citiesPickerView 的 UIPickerViewDelegate 202 // 显示内容 203 - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component 204 { 205 if (0 == component) { 206 // 省份列 207 return [self.cities[row] name]; 208 }else 209 { 210 // 城市列 211 return self.tempArray[row]; 212 } 213 } 214 // 监听pickerView的选中 215 - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component 216 { 217 // 判断是否修改了省份列 218 NSString *province = nil; 219 NSString *city = nil; 220 if (0 == component) { 221 // 保存新的城市数组 222 self.tempArray = [self.cities[row] cities]; 223 // 刷新城市列对应的数据 224 [pickerView reloadComponent:1]; 225 // 让城市列滚动到第0行 226 [pickerView selectRow:0 inComponent:1 animated:YES]; 227 228 province = [self.cities[row] name]; 229 city = self.tempArray[0]; 230 231 }else 232 { 233 NSInteger selectProvinceIndex = [pickerView selectedRowInComponent:0]; 234 province = [self.cities[selectProvinceIndex] name]; 235 city = self.tempArray[row]; 236 } 237 238 self.inputaddressTextField.text = [NSString stringWithFormat:@"%@ - %@", province, city]; 239 } 240 241 @end
LWTCityModel.h
#import <Foundation/Foundation.h> @interface LWTCityModel : NSObject @property (nonatomic, copy) NSString *name; @property (nonatomic, strong) NSArray *cities; LWTInitH(city) @end
LWTCityModel.m
#import "LWTCityModel.h" @implementation LWTCityModel LWTInitM(city) @end
LWTGlobal.h
// // LWTGlobal.h // tableView练习--英雄联盟英雄介绍 // // Created by apple on 14-5-27. // Copyright (c) 2014年 lwt. All rights reserved. // #ifndef tableView_____________LWTGlobal_h #define tableView_____________LWTGlobal_h #define LWTInitH(name)\ - (instancetype)initWithDict : (NSDictionary *)dict; \ + (instancetype)name##WithDict : (NSDictionary *)dict; #define LWTInitM(name) \ - (instancetype)initWithDict:(NSDictionary *)dict\ {\ self = [super init];\ if (self) {\ [self setValuesForKeysWithDictionary:dict];\ }\ return self;\ }\ + (instancetype)name##WithDict:(NSDictionary *)dict\ {\ return [[self alloc] initWithDict:dict];\ } #endif
cities.plist
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>cities</key> <array> <string>福州</string> <string>龙岩</string> <string>南平</string> <string>宁德</string> <string>莆田</string> <string>泉州</string> <string>三明</string> <string>厦门</string> <string>永安</string> <string>漳州</string> </array> <key>name</key> <string>福建</string> </dict> <dict> <key>cities</key> <array> <string>济南</string> <string>滨州</string> <string>德州</string> <string>东营</string> <string>肥城</string> <string>海阳</string> <string>菏泽</string> <string>济宁</string> <string>莱芜</string> <string>莱阳</string> <string>聊城</string> <string>临沂</string> <string>平度</string> <string>青岛</string> <string>青州</string> <string>日照</string> <string>泰安</string> <string>威海</string> <string>潍坊</string> <string>烟台</string> <string>枣庄</string> <string>章丘</string> <string>淄博</string> </array> <key>name</key> <string>山东</string> </dict> <dict> <key>cities</key> <array> <string>成都</string> <string>阿坝</string> <string>巴中</string> <string>崇州</string> <string>达州</string> <string>大邑</string> <string>德阳</string> <string>都江堰</string> <string>峨眉山</string> <string>甘孜</string> <string>广安</string> <string>广元</string> <string>江油</string> <string>金堂</string> <string>乐山</string> <string>泸州</string> <string>眉山</string> <string>绵阳</string> <string>内江</string> <string>南充</string> <string>攀枝花</string> <string>遂宁</string> <string>西昌</string> <string>雅安</string> <string>宜宾</string> <string>资阳</string> <string>自贡</string> </array> <key>name</key> <string>四川</string> </dict> <dict> <key>cities</key> <array> <string>昆明</string> <string>保山</string> <string>楚雄</string> <string>大理</string> <string>德宏</string> <string>迪庆</string> <string>个旧</string> <string>丽江</string> <string>临沧</string> <string>怒江</string> <string>曲靖</string> <string>思茅</string> <string>文山</string> <string>西双版纳</string> <string>玉溪</string> <string>昭通</string> </array> <key>name</key> <string>云南</string> </dict> <dict> <key>cities</key> <array> <string>东城区</string> <string>西城区</string> <string>崇文区</string> <string>宣武区</string> <string>海淀区</string> <string>朝阳区</string> <string>丰台区</string> <string>石景山区</string> <string>通州区</string> <string>顺义区</string> <string>房山区</string> <string>大兴区</string> <string>昌平区</string> <string>怀柔区</string> <string>平谷区</string> <string>门头沟区</string> <string>密云县</string> <string>延庆县</string> </array> <key>name</key> <string>北京</string> </dict> <dict> <key>cities</key> <array> <string>石家庄</string> <string>保定</string> <string>泊头</string> <string>沧州</string> <string>承德</string> <string>邯郸</string> <string>河间</string> <string>衡水</string> <string>廊坊</string> <string>秦皇岛</string> <string>任丘</string> <string>唐山</string> <string>邢台</string> <string>张家口</string> </array> <key>name</key> <string>河北</string> </dict> <dict> <key>cities</key> <array> <string>南京</string> <string>常州</string> <string>高邮</string> <string>淮安</string> <string>连云港</string> <string>南通</string> <string>苏州</string> <string>宿迁</string> <string>太仓</string> <string>泰州</string> <string>无锡</string> <string>新沂</string> <string>徐州</string> <string>盐城</string> <string>扬州</string> <string>镇江</string> </array> <key>name</key> <string>江苏</string> </dict> <dict> <key>cities</key> <array> <string>台北</string> <string>高雄</string> <string>台南</string> <string>台中</string> </array> <key>name</key> <string>台湾</string> </dict> <dict> <key>cities</key> <array> <string>沈阳</string> <string>鞍山</string> <string>本溪</string> <string>朝阳</string> <string>大连</string> <string>丹东</string> <string>抚顺</string> <string>阜新</string> <string>葫芦岛</string> <string>锦州</string> <string>辽阳</string> <string>盘锦</string> <string>铁岭</string> <string>营口</string> </array> <key>name</key> <string>辽宁</string> </dict> <dict> <key>cities</key> <array> <string>长春</string> <string>白城</string> <string>白山</string> <string>珲春</string> <string>吉林</string> <string>辽源</string> <string>龙井</string> <string>舒兰</string> <string>四平</string> <string>松原</string> <string>通化</string> <string>延边</string> </array> <key>name</key> <string>吉林</string> </dict> <dict> <key>cities</key> <array> <string>呼和浩特</string> <string>阿拉善盟</string> <string>巴彦淖尔盟</string> <string>包头</string> <string>赤峰</string> <string>鄂尔多斯</string> <string>呼伦贝尔</string> <string>通辽</string> <string>乌海</string> <string>乌兰察布盟</string> <string>锡林郭勒盟</string> <string>兴安盟</string> </array> <key>name</key> <string>内蒙古</string> </dict> <dict> <key>cities</key> <array> <string>杭州</string> <string>北仑</string> <string>慈溪</string> <string>奉化</string> <string>湖州</string> <string>嘉兴</string> <string>金华</string> <string>丽水</string> <string>临海</string> <string>宁波</string> <string>宁海</string> <string>衢州</string> <string>三门</string> <string>绍兴</string> <string>台州</string> <string>天台</string> <string>温岭</string> <string>温州</string> <string>仙居</string> <string>象山</string> <string>义乌</string> <string>余姚</string> <string>舟山</string> </array> <key>name</key> <string>浙江</string> </dict> <dict> <key>cities</key> <array> <string>拉萨</string> <string>阿里</string> <string>昌都</string> <string>林芝</string> <string>那曲</string> <string>日喀则</string> <string>山南</string> </array> <key>name</key> <string>西藏</string> </dict> <dict> <key>cities</key> <array> <string>西宁</string> <string>果洛</string> <string>海北</string> <string>海东</string> <string>海南</string> <string>海西</string> <string>黄南</string> <string>玉树</string> </array> <key>name</key> <string>青海</string> </dict> <dict> <key>cities</key> <array> <string>澳门</string> </array> <key>name</key> <string>澳门</string> </dict> <dict> <key>cities</key> <array> <string>武汉</string> <string>鄂州</string> <string>恩施</string> <string>黄冈</string> <string>黄石</string> <string>荆门</string> <string>荆州</string> <string>潜江</string> <string>十堰</string> <string>随州</string> <string>天门</string> <string>仙桃</string> <string>咸宁</string> <string>襄樊</string> <string>孝感</string> <string>宜昌</string> </array> <key>name</key> <string>湖北</string> </dict> <dict> <key>cities</key> <array> <string>哈尔滨</string> <string>大庆</string> <string>大兴安岭</string> <string>鹤岗</string> <string>黑河</string> <string>虎林</string> <string>鸡西</string> <string>佳木斯</string> <string>密山</string> <string>牡丹江</string> <string>宁安</string> <string>七台河</string> <string>齐齐哈尔</string> <string>双鸭山</string> <string>绥化</string> <string>五常</string> <string>伊春</string> </array> <key>name</key> <string>黑龙江</string> </dict> <dict> <key>cities</key> <array> <string>南宁</string> <string>百色</string> <string>北海</string> <string>北流</string> <string>崇左</string> <string>防城港</string> <string>贵港</string> <string>桂林</string> <string>桂平</string> <string>河池</string> <string>贺州</string> <string>来宾</string> <string>柳州</string> <string>钦州</string> <string>梧州</string> <string>宜州</string> <string>玉林</string> </array> <key>name</key> <string>广西</string> </dict> <dict> <key>cities</key> <array> <string>郑州</string> <string>安阳</string> <string>鹤壁</string> <string>济源</string> <string>焦作</string> <string>开封</string> <string>洛阳</string> <string>漯河</string> <string>南阳</string> <string>平顶山</string> <string>濮阳</string> <string>三门峡</string> <string>商丘</string> <string>新乡</string> <string>信阳</string> <string>许昌</string> <string>周口</string> <string>驻马店</string> </array> <key>name</key> <string>河南</string> </dict> <dict> <key>cities</key> <array> <string>太原</string> <string>长治</string> <string>大同</string> <string>晋城</string> <string>晋中</string> <string>临汾</string> <string>吕梁</string> <string>朔州</string> <string>忻州</string> <string>阳泉</string> <string>运城</string> </array> <key>name</key> <string>山西</string> </dict> <dict> <key>cities</key> <array> <string>重庆</string> </array> <key>name</key> <string>重庆</string> </dict> <dict> <key>cities</key> <array> <string>南昌</string> <string>抚州</string> <string>赣州</string> <string>吉安</string> <string>景德镇</string> <string>九江</string> <string>萍乡</string> <string>上饶</string> <string>新余</string> <string>宜春</string> <string>鹰潭</string> </array> <key>name</key> <string>江西</string> </dict> <dict> <key>cities</key> <array> <string>天津</string> </array> <key>name</key> <string>天津</string> </dict> <dict> <key>cities</key> <array> <string>银川</string> <string>固原</string> <string>石嘴山</string> <string>吴忠</string> <string>中卫</string> </array> <key>name</key> <string>宁夏</string> </dict> <dict> <key>cities</key> <array> <string>西安</string> <string>安康</string> <string>宝鸡</string> <string>汉中</string> <string>商洛</string> <string>铜川</string> <string>渭南</string> <string>咸阳</string> <string>兴平</string> <string>延安</string> <string>榆林</string> </array> <key>name</key> <string>陕西</string> </dict> <dict> <key>cities</key> <array> <string>上海</string> </array> <key>name</key> <string>上海</string> </dict> <dict> <key>cities</key> <array> <string>香港</string> </array> <key>name</key> <string>香港</string> </dict> <dict> <key>cities</key> <array> <string>广州</string> <string>潮州</string> <string>从化</string> <string>东莞</string> <string>佛山</string> <string>河源</string> <string>鹤山</string> <string>化州</string> <string>惠州</string> <string>江门</string> <string>揭阳</string> <string>茂名</string> <string>梅州</string> <string>清远</string> <string>汕头</string> <string>汕尾</string> <string>韶关</string> <string>深圳</string> <string>阳江</string> <string>云浮</string> <string>湛江</string> <string>肇庆</string> <string>中山</string> <string>珠海</string> </array> <key>name</key> <string>广东</string> </dict> <dict> <key>cities</key> <array> <string>兰州</string> <string>白银</string> <string>定西</string> <string>甘南</string> <string>嘉峪关</string> <string>酒泉</string> <string>临夏</string> <string>陇南</string> <string>平凉</string> <string>庆阳</string> <string>天水</string> <string>武威</string> <string>张掖</string> </array> <key>name</key> <string>甘肃</string> </dict> <dict> <key>cities</key> <array> <string>贵阳</string> <string>安顺</string> <string>毕节</string> <string>都匀</string> <string>凯里</string> <string>六盘水</string> <string>铜仁</string> <string>兴义</string> <string>遵义</string> </array> <key>name</key> <string>贵州</string> </dict> <dict> <key>cities</key> <array> <string>乌鲁木齐</string> <string>阿克苏</string> <string>阿拉尔</string> <string>阿图什</string> <string>博乐</string> <string>昌吉</string> <string>哈密</string> <string>和田</string> <string>喀什</string> <string>克拉玛依</string> <string>库尔勒</string> <string>石河子</string> <string>图木舒克</string> <string>吐鲁番</string> <string>五家渠</string> <string>伊宁</string> </array> <key>name</key> <string>新疆</string> </dict> <dict> <key>cities</key> <array> <string>长沙</string> <string>常德</string> <string>郴州</string> <string>衡阳</string> <string>怀化</string> <string>吉首</string> <string>耒阳</string> <string>冷水江</string> <string>娄底</string> <string>韶山</string> <string>邵阳</string> <string>湘潭</string> <string>湘乡</string> <string>益阳</string> <string>永州</string> <string>岳阳</string> <string>张家界</string> <string>株州</string> </array> <key>name</key> <string>湖南</string> </dict> <dict> <key>cities</key> <array> <string>合肥</string> <string>安庆</string> <string>蚌埠</string> <string>亳州</string> <string>巢湖</string> <string>池州</string> <string>滁州</string> <string>阜阳</string> <string>淮北</string> <string>淮南</string> <string>黄山</string> <string>黄山景区</string> <string>九华山景区</string> <string>六安</string> <string>马鞍山</string> <string>青阳</string> <string>宿州</string> <string>铜陵</string> <string>芜湖</string> <string>宣城</string> </array> <key>name</key> <string>安徽</string> </dict> <dict> <key>cities</key> <array> <string>海口</string> <string>儋州</string> <string>东方</string> <string>琼海</string> <string>三亚</string> <string>万宁</string> <string>文昌</string> <string>五指山</string> </array> <key>name</key> <string>海南</string> </dict> </array> </plist>