- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在创建一个带有状态列表的 UITableView,一旦您在其中一个单元格中选择一个状态,它将切换到下一个 View ,该 View 将具有与该状态相对应的城市列表。到目前为止,这就是我对我的一系列城市的了解:
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
NSMutableArray *mainArray = [[NSMutableArray alloc] init];
self.section1 = @[@"Alabama",@"Alaska",@"Arizona",@"Arkansas",@"California",@"Colorado",@"Connecticut",@"Delaware"];
self.section2 = @[@"Florida",@"Georgia",@"Hawaii",@"Idaho",@"Illinois",@"Indiana",@"Iowa",@"Kansas",@"Kentucky",@"Louisiana"];
self.section3 = @[@"Maine",@"Maryland",@"Massachusetts",@"Michigan",@"Minnesota",@"Mississippi",@"Misouri",@"Montana"];
self.section4 = @[@"Nevada",@"Nebraska",@"New Hampshire",@"New Jersey",@"New Mexico",@"New York",@"North Carolina",@"North Dakota",@"Ohio",@"Ohio",@"Oklahoma",@"Oregon"];
self.section5 = @[@"Pennsylvania",@"Rhode Island",@"South Carolina",@"South Dakota",@"Tennessee",@"Texas",@"Utah"];
self.section6 = @[@"Vermont",@"Virginia",@"Washington",@"West Virginia",@"Wisconsin",@"Wyoming"];
}
return self;
}
self.Alabama = @[@"auburn",
@"birmingham",
@"dothan",
@"florence / muscle shoals",
@"gadsden-anniston",
@"huntsville / decatur",
@"mobile",
@"montgomery",
@"tuscaloosa"];
self.Alaska = @[@"anchorage / mat-su",
@"fairbanks",
@"kenai peninsula",
@"southeast alaska"];
self.Arizona = @[@"flagstaff / sedona",
@"mohave county",
@"phoenix",
@"prescott",
@"show low",
@"sierra vista",
@"tucson",
@"yuma"];
self.Arkansas = @[@"fayetteville",
@"fort smith",
@"jonesboro",
@"little rock",
@"texarkana"];
self.California = @[@"bakersfield",
@"chico",
@"fresno / madera",
@"gold country",
@"hanford-corcoran",
@"humboldt county",
@"imperial county",
@"inland empire",
@"los angeles",
@"mendocino county",
@"merced",
@"modesto",
@"monterey bay",
@"orange county",
@"palm springs",
@"redding",
@"sacramento",
@"san diego",
@"san francisco bay area",
@"san luis obispo",
@"santa barbara",
@"santa maria",
@"siskiyou county",
@"stockton",
@"susanville",
@"ventura county",
@"visalia-tulare",
@"yuba-sutter"];
self.Colorado = @[@"boulder",
@"colorado springs",
@"denver",
@"eastern CO",
@"fort collins / north CO",
@"high rockies",
@"pueblo",
@"western slope"];
self.Connecticut = @[@"eastern CT",
@"hartford",
@"new haven",
@"northwest CT"];
self.Delaware = @[@"delware"];
self.Florida = @[@"daytona beach",
@"florida keys",
@"fort lauderdale",
@"ft myers / SW florida",
@"gainesville",
@"heartland florida",
@"jacksonville",
@"lakeland",
@"north central FL",
@"ocala",
@"okaloosa / walton",
@"orlando",
@"panama city",
@"pensacola",
@"sarasota-bradenton",
@"south florida",
@"space coast",
@"st augustine",
@"tallahassee",
@"tampa bay area",
@"treasure coast",
@"west palm beach"];
self.Georgia = @[@"albany",
@"athens",
@"atlanta",
@"augusta",
@"brunswick",
@"columbus",
@"macon / warner robins",
@"northwest GA",
@"savannah / hinesville",
@"statesboro",
@"valdosta"];
self.Hawaii = @[@"hawaii"];
self.Idaho = @[@"boise",
@"east idaho",
@"lewiston / clarkston",
@"twin falls"];
self.Illinois = @[@"bloomington-normal",
@"champaign urbana",
@"chicago",
@"decatur",
@"la salle co",
@"mattoon-charleston",
@"peoria",
@"rockford",
@"southern illinois",
@"springfield",
@"western IL"];
self.Indiana = @[@"bloomington",
@"evansville",
@"fort wayne",
@"indianapolis",
@"kokomo",
@"lafayette / west lafayette",
@"muncie / anderson",
@"richmond",
@"south bend / michiana",
@"terre haute"];
self.Iowa = @[@"ames",
@"cedar rapids",
@"des moines",
@"dubuque",
@"fort dodge",
@"iowa city",
@"mason city",
@"quad cities",
@"sioux city",
@"southeast IA",
@"waterloo / cedar falls"];
self.Kansas = @[@"lawrence",
@"manhattan",
@"northwest KS",
@"salina",
@"southeast KS",
@"southwest KS",
@"topeka",
@"wichita"];
self.Kentucky = @[@"bowling green",
@"eastern kentucky",
@"lexington",
@"louisville",
@"owensboro",
@"western KY"];
self.Louisiana = @[@"baton rouge",
@"central louisiana",
@"houma",
@"lafayette",
@"lake charles",
@"monroe",
@"new orleans",
@"shreveport"];
self.Maine = @[@"maine"];
self.Maryland = @[@"annapolis",
@"baltimore",
@"eastern shore",
@"frederick",
@"southern maryland",
@"western maryland"];
self.Massachusetts = @[@"boston",
@"cape cod / islands",
@"south coast",
@"western massachusetts",
@"worcester / central MA"];
self.Michigan = @[@"ann arbor",
@"battle creek",
@"central michigan",
@"detroit metro",
@"flint",
@"grand rapids",
@"holland",
@"jackson",
@"kalamazoo",
@"lansing",
@"monroe",
@"muskegon",
@"northern michigan",
@"port huron",
@"saginaw-midland-baycity",
@"southwest michigan",
@"the thumb",
@"upper peninsula"];
self.Mississippi = @[@"gulfport / biloxi",
@"hattiesburg",
@"jackson",
@"meridian",
@"north mississippi",
@"southwest MS"];
self.Minnesota = @[@"bemidji",
@"brainerd",
@"duluth / superior",
@"mankato",
@"minneapolis / st paul",
@"rochester",
@"southwest MN",
@"st cloud"];
self.Missouri = @[@"columbia / jeff city",
@"joplin",
@"kansas city",
@"kirksville",
@"lake of the ozarks",
@"southeast missouri",
@"springfield",
@"st joseph",
@"st louis"];
self.Montana = @[@"billings",
@"bozeman",
@"butte",
@"great falls",
@"helena",
@"kalispell",
@"missoula",
@"eastern montana"];
self.Nebraska = @[@"grand island",
@"lincoln",
@"north platte",
@"omaha / council bluffs",
@"scottsbluff / panhandle"];
self.Nevada = @[@"elko",
@"las vegas",
@"reno / tahoe"];
self.NewHampshire = @[@"New Hampshire"];
self.NewJersey = @[@"central NJ",
@"jersey shore",
@"north jersey",
@"south jersey"];
self.NewMexico = @[@"albuquerque",
@"clovis / portales",
@"farmington",
@"las cruces",
@"roswell / carlsbad",
@"santa fe / taos"];
self.NewYork = @[@"albany",
@"binghamton",
@"buffalo",
@"catskills",
@"chautauqua",
@"elmira-corning",
@"finger lakes",
@"glens falls",
@"hudson valley",
@"ithaca",
@"long island",
@"new york city",
@"oneonta",
@"plattsburgh-adirondacks",
@"potsdam-canton-massena",
@"rochester",
@"syracuse",
@"twin tiers NY/PA",
@"utica-rome-oneida",
@"watertown"];
self.NorthCarolina = @[@"asheville",
@"boone",
@"charlotte",
@"eastern NC",
@"fayetteville",
@"greensboro",
@"hickory / lenoir",
@"jacksonville",
@"outer banks",
@"raleigh / durham / CH",
@"wilmington",
@"winston-salem"];
self.NorthDakota = @[@"bismarck",
@"fargo / moorhead",
@"grand forks",
@"north dakota"];
self.Ohio = @[@"akron / canton",
@"ashtabula",
@"athens",
@"chillicothe",
@"cincinnati",
@"cleveland",
@"columbus",
@"dayton / springfield",
@"lima / findlay",
@"mansfield",
@"sandusky",
@"toledo",
@"tuscarawas co",
@"youngstown",
@"zanesville / cambridge"];
self.Oklahoma = @[@"lawton",
@"northwest OK",
@"oklahoma city",
@"stillwater",
@"tulsa"];
self.Oregon = @[@"bend",
@"corvallis/albany",
@"east oregon",
@"eugene",
@"klamath falls",
@"medford-ashland",
@"oregon coast",
@"portland",
@"roseburg",
@"salem"];
self.Pennsylvania = @[@"altoona-johnstown",
@"cumberland valley",
@"erie",
@"harrisburg",
@"lancaster",
@"lehigh valley",
@"meadville",
@"philadelphia",
@"pittsburgh",
@"poconos",
@"reading",
@"scranton / wilkes-barre",
@"state college",
@"williamsport",
@"york"];
self.RhodeIsland = @[@"Rhode Island"];
self.SouthCarolina = @[@"charleston",
@"columbia",
@"florence",
@"greenville / upstate",
@"hilton head",
@"myrtle beach"];
self.SouthDakota = @[@"northeast SD",
@"pierre / central SD",
@"rapid city / west SD",
@"sioux falls / SE SD",
@"south dakota"];
self.Tennessee = @[@"chattanooga",
@"clarksville",
@"cookeville",
@"jackson",
@"knoxville",
@"memphis",
@"nashville",
@"tri-cities"];
self.Texas = @[@"abilene",
@"amarillo",
@"austin",
@"beaumont / port arthur",
@"brownsville",
@"college station",
@"corpus christi",
@"dallas / fort worth",
@"deep east texas",
@"del rio / eagle pass",
@"el paso",
@"galveston",
@"houston",
@"killeen / temple / ft hood",
@"laredo",
@"lubbock",
@"mcallen / edinburg",
@"odessa / midland",
@"san angelo",
@"san antonio",
@"san marcos",
@"southwest TX",
@"texoma",
@"tyler / east TX",
@"victoria",
@"waco",
@"wichita falls"];
self.Utah = @[@"logan",
@"ogden-clearfield",
@"provo / orem",
@"salt lake city",
@"st george"];
self.Vermont = @[@"Vermont"];
self.Virginia = @[@"charlottesville",
@"danville",
@"fredericksburg",
@"hampton roads",
@"harrisonburg",
@"lynchburg",
@"new river valley",
@"richmond",
@"roanoke",
@"southwest VA",
@"winchester"];
self.Washington = @[@"bellingham",
@"kennewick-pasco-richland",
@"moses lake",
@"olympic peninsula",
@"pullman / moscow",
@"seattle-tacoma",
@"skagit / island / SJI",
@"spokane / coeur d'alene",
@"wenatchee",
@"yakima"];
self.WestVirginia = @[@"charleston",
@"eastern panhandle",
@"huntington-ashland",
@"morgantown",
@"northern panhandle",
@"parkersburg-marietta",
@"southern WV",
@"west virginia (old)"];
self.Wisconsin = @[@"appleton-oshkosh-FDL",
@"eau claire",
@"green bay",
@"janesville",
@"kenosha-racine",
@"la crosse",
@"madison",
@"milwaukee",
@"northern WI",
@"sheboygan",
@"wausau"];
self.Wyoming = @[@"Wyoming"];
NSMutableDictionary *dic1=[[NSMutableDictionary alloc]init];
[dic1 setValue:@"Alabama" forKey:@"state"];
[dic1 setValue:self.Alabama forKey:@"cities"];
NSMutableDictionary *dic2=[[NSMutableDictionary alloc]init];
[dic2 setValue:@"Alaska" forKey:@"state"];
[dic2 setValue:self.Alaska forKey:@"cities"];
NSMutableDictionary *dic3=[[NSMutableDictionary alloc]init];
[dic3 setValue:@"Arizona" forKey:@"states"];
[dic3 setValue:self.Arizona forKey:@"cities"];
NSMutableDictionary *dic4=[[NSMutableDictionary alloc]init];
[dic4 setValue:@"Arkansas" forKey:@"states"];
[dic4 setValue:self.Arkansas forKey:@"cities"];
NSMutableDictionary *dic5=[[NSMutableDictionary alloc]init];
[dic5 setValue:@"California" forKey:@"states"];
[dic5 setValue:self.California forKey:@"cities"];
NSMutableDictionary *dic6=[[NSMutableDictionary alloc]init];
[dic6 setValue:@"Colorado" forKey:@"states"];
[dic6 setValue:self.Colorado forKey:@"cities"];
NSMutableDictionary *dic7=[[NSMutableDictionary alloc]init];
[dic7 setValue:@"Connecticut" forKey:@"state"];
[dic7 setValue:self.Connecticut forKey:@"cities"];
NSMutableDictionary *dic8=[[NSMutableDictionary alloc]init];
[dic8 setValue:@"Delaware" forKey:@"state"];
[dic8 setValue:self.Delaware forKey:@"cities"];
NSMutableDictionary *dic9=[[NSMutableDictionary alloc]init];
[dic9 setValue:@"Florida" forKey:@"states"];
[dic9 setValue:self.Florida forKey:@"cities"];
NSMutableDictionary *dic10=[[NSMutableDictionary alloc]init];
[dic10 setValue:@"Georgia" forKey:@"states"];
[dic10 setValue:self.Georgia forKey:@"cities"];
NSMutableDictionary *dic11=[[NSMutableDictionary alloc]init];
[dic11 setValue:@"Hawaii" forKey:@"states"];
[dic11 setValue:self.Hawaii forKey:@"cities"];
NSMutableDictionary *dic12=[[NSMutableDictionary alloc]init];
[dic12 setValue:@"Idaho" forKey:@"states"];
[dic12 setValue:self.Idaho forKey:@"cities"];
NSMutableDictionary *dic13=[[NSMutableDictionary alloc]init];
[dic13 setValue:@"Illinois" forKey:@"state"];
[dic13 setValue:self.Illinois forKey:@"cities"];
NSMutableDictionary *dic14=[[NSMutableDictionary alloc]init];
[dic14 setValue:@"Indiana" forKey:@"state"];
[dic14 setValue:self.Indiana forKey:@"cities"];
NSMutableDictionary *dic15=[[NSMutableDictionary alloc]init];
[dic15 setValue:@"Iowa" forKey:@"states"];
[dic15 setValue:self.Iowa forKey:@"cities"];
NSMutableDictionary *dic16=[[NSMutableDictionary alloc]init];
[dic16 setValue:@"Kansas" forKey:@"states"];
[dic16 setValue:self.Kansas forKey:@"cities"];
NSMutableDictionary *dic17=[[NSMutableDictionary alloc]init];
[dic17 setValue:@"Kentucky" forKey:@"states"];
[dic17 setValue:self.Kentucky forKey:@"cities"];
NSMutableDictionary *dic18=[[NSMutableDictionary alloc]init];
[dic18 setValue:@"Louisiana" forKey:@"states"];
[dic18 setValue:self.Louisiana forKey:@"cities"];
NSMutableDictionary *dic19=[[NSMutableDictionary alloc]init];
[dic19 setValue:@"Maine" forKey:@"state"];
[dic19 setValue:self.Maine forKey:@"cities"];
NSMutableDictionary *dic20=[[NSMutableDictionary alloc]init];
[dic20 setValue:@"Maryland" forKey:@"state"];
[dic20 setValue:self.Maryland forKey:@"cities"];
NSMutableDictionary *dic21=[[NSMutableDictionary alloc]init];
[dic21 setValue:@"Massachusetts" forKey:@"states"];
[dic21 setValue:self.Massachusetts forKey:@"cities"];
NSMutableDictionary *dic22=[[NSMutableDictionary alloc]init];
[dic22 setValue:@"Michigan" forKey:@"states"];
[dic22 setValue:self.Michigan forKey:@"cities"];
NSMutableDictionary *dic23=[[NSMutableDictionary alloc]init];
[dic23 setValue:@"Minnesota" forKey:@"states"];
[dic23 setValue:self.Minnesota forKey:@"cities"];
NSMutableDictionary *dic24=[[NSMutableDictionary alloc]init];
[dic24 setValue:@"Mississippi" forKey:@"states"];
[dic24 setValue:self.Mississippi forKey:@"cities"];
NSMutableDictionary *dic25=[[NSMutableDictionary alloc]init];
[dic25 setValue:@"Missouri" forKey:@"states"];
[dic25 setValue:self.Missouri forKey:@"cities"];
NSMutableDictionary *dic26=[[NSMutableDictionary alloc]init];
[dic26 setValue:@"Montana" forKey:@"states"];
[dic26 setValue:self.Montana forKey:@"cities"];
NSMutableDictionary *dic27=[[NSMutableDictionary alloc]init];
[dic27 setValue:@"Nebraska" forKey:@"states"];
[dic27 setValue:self.Nebraska forKey:@"cities"];
NSMutableDictionary *dic28=[[NSMutableDictionary alloc]init];
[dic28 setValue:@"Nevada" forKey:@"states"];
[dic28 setValue:self.Nevada forKey:@"cities"];
最佳答案
我建议为每个州设置一个类,其中您有诸如州的 NSString 和包含所有相应城市的数组之类的属性。然后,将状态对象存储在以状态名称作为键的字典中。
关于ios - 创建一个城市和州的字典,以便在 UITableView 中存储一个字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19236555/
我坚持我的项目(用 Swift 编写) 我有一个 UITableView,它有一个字符串,它提供了表格中的十个类别。我想做的是选择这些类别中的一个来触摸它,然后打开一个包含其他类别的 secondTa
好的,这从 iOS 7 Beta 6 开始就被打破了。 在启动时,我将表格 View 的背景更改为图像(如果我将其设置为颜色,它会做同样的事情)并且表格单元格是白色的...... 当我选择一个单元格时
我有一个包含不同部分的 UITableView,每个单元格上都有一个图像。因为图像是为每个单元格单独下载的,所以我正在寻找一种延迟加载解决方案。 在 iOS Developer Library 上,它
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
可以在UIRefreshControl的底部添加UITableView吗? 我会用它来加载更多数据。 拜托,有什么建议吗? 最佳答案 我相信不会有任何简单的解决方案来解决这个问题。可能有人可以编写一个
我有一个 UITableView 和一个使用 Swift 的自定义 UITableViewCell。当我设置 self.MyTable.editing = true 时,我看到该行上有删除图标,并且似
我为 iPhone 创建了一个下载器应用程序。我有用于显示主动/被动下载的表格 View 。在 tableview 的自定义单元格中有进度条,它显示 %XX 下载状态。现在我正在使用 NSTimer
我正在编写 UITableView 的自定义子类。我需要这个对象本身成为它自己的数据源和委托(delegate),然后这个子类将有它自己的数据源和委托(delegate)。这主要是为了让我可以拦截对数
我有一个问题已经困扰我几天了。 我有一个名为 countries 的数组。该数组包含一个自定义对象,其中包含国家、城市、IP、状态等数据。 我需要在按属性“国家/地区”划分的表格 View 中显示这些
我有一个 UITableViewController,目前显示 4 个将始终显示的单元格,并且想将它们组合在一起,但我不知道如何操作。当在 UIViewController 或类似的东西上插入标准 U
我以编程方式创建了一个 UITableView,现在我想向它添加一个固定的标题。 正如我下面的代码一样,标题也随着我的 tableview 滚动。 UILabel *label = [[[UI
我正在创建一个 UITableViewController(在 UINavigationController 的根部)并在另一个 View Controller 之上以模态方式呈现它。我让它在一定程度
我有问题。我有动态 TableView 。所以我需要在我的 textLabel 中更改文本大小。我试过: 一个: cell.textLabel.font = [UIFont systemFontOfS
iOS 8 中的新功能是 separatorEffect属性,您可以为其分配 UIVisualEffect。有没有人知道这是做什么用的?我试过了,我不认为它有任何,呃,视觉效果。 最佳答案 我想知道完
今天早上,我刚刚安装了包含iOS 6的新Xcode。 我有一个加载了包含章节和行的plist文件的表格 View 。各章定义各节。 用户选择章节和行,并将tableview自动滚动到正确的位置(在vi
我在iOS 7上启动VoiceOver时遇到了一些麻烦。我确实在UITableViewHeaderFooterView中注册了viewDidLoad子类的实例,但是当我用-[tableView deq
我在 UITableView 中添加了一些数据,我想更改单元格中显示的文本的颜色。 是否有委托(delegate)方法可以执行此操作,或者有其他方式吗? 最佳答案 无需标签 您只需要编码: cell.
是否可以在滚动 UITableView 时动态更改单元格的高度? 当用户将其向下拖动到顶部时,滚动位置到达某个点时,我需要更改多个单元格的高度。我可以通过发出 reloadData 成功地做到这一点,
我正在使用 iOS 5,并在表格中动态生成单元格(2 个部分,每个部分 3 行)。每个部分都有一个标题,该标题也是使用 titleForHeaderInSection 调用动态生成的。 我还设置了一个
我正在寻找 UITableView 的回调函数当我使用 Apple Remote 导航并按向上或向下键选择行时(而不是按 Enter 键时),当该行聚焦时。 在 iOS 上,我们有 didSelect
我是一名优秀的程序员,十分优秀!