【代码笔记】iOS-点击任何处,出现城市

来源:互联网 发布:好用的精华液 知乎 编辑:程序博客网 时间:2024/06/06 01:10

一,效果图。

二,工程目录。

三,代码。

复制代码
//点击任何处,出现城市-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{    UIActionSheet *city=[[UIActionSheet alloc] initWithTitle:@"城市选择" delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"北京",@"上海",@"天津",@"重庆",@"哈尔滨",@"长春",@"沈阳",@"呼和浩特",@"石家庄",@"乌鲁木齐",@"兰州",@"西安",@"西宁",@"银川",@"郑州",@"济南",@"太原",@"合肥",@"武汉",@"南京",@"成都",@"贵阳",@"昆明",@"南宁",@"拉萨",@"杭州",@"南昌",@"广州",@"福州",@"台北",@"海口",@"香港",@"澳门", nil];    city.backgroundColor=[UIColor orangeColor];    [city showInView:self.view];    }
复制代码

 

0 0
原创粉丝点击