#MKMapView的基本应用和定位实现介绍:MKMapView是iOS平台提供的地图API使用方法:首先导入MapKit.framework框架并包含头文件###创建地图视图:```objcMKMapView
*mapView = [[MKMapView alloc] initWithFrame:...
分类:
其他好文 时间:
2014-05-27 00:09:44
阅读次数:
329
//在viewDidLoad方法中创建Toolbartoolbar = [[UIView
alloc] initWithFrame:CGRectMake(0, 0, 320, 66)];toolbar.backgroundColor =
[UIColor redColor];//添加到tableVi...
分类:
移动开发 时间:
2014-05-26 13:29:07
阅读次数:
207
之 前在初始化一个类的时候:TestViewController
*viewcontroller=[[TestViewController alloc]initWithNibName:@"TestViewController"
bundle:[NSBundle mainBundle]];不是很明白:...
分类:
其他好文 时间:
2014-05-26 07:12:17
阅读次数:
179
1. Locale
设置DatePicker的地区,即设置DatePicker显示的语言。
// 1.跟踪所有可用的地区,取出想要的地区
NSLog(@"%@", [NSLocale availableLocaleIdentifiers]);
// 2. 设置日期选择控件的地区
[datePicker setLocale:[[NSLocale
alloc]initW...
分类:
其他好文 时间:
2014-05-25 16:18:23
阅读次数:
294
1.首先定义属性@property (nonatomic, retain)
UISearchDisplayController *searchDisplayController;2.创建一个UISearchBarUISearchBar
*search = [[UISearchBar alloc] i...
分类:
其他好文 时间:
2014-05-23 23:52:19
阅读次数:
430
话不多少,直接上代码,思路还是挺简单的。
UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.frame];
// HTML文件来自Project
// 步骤:path - > url - > request with url - > loadRequest
NSStrin...
分类:
编程语言 时间:
2014-05-22 23:53:05
阅读次数:
442
利用CAShapeLayer可以制作出任意的几何图形,把它作为UIImageView的遮罩,达到把图片做成圆形效果。
imgView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 35, 80, 80)];
imgView.image = [UIImage imageNamed:@"ma.jpg"];
UIBez...
分类:
移动开发 时间:
2014-05-22 22:51:33
阅读次数:
485
关于UIActionSheet,我们经常用到的就是
UIActionSheet *actionSheet = [[UIActionSheet
alloc]initWithTitle:@"请选择"
delegate:self
cancelButtonTitle:@"取消"destructiveButtonTitle:@"确定"
otherButtonTitles:@"1",@"2",@...
分类:
其他好文 时间:
2014-05-22 09:51:25
阅读次数:
385
设置日期期限的时候下面这个方法用不了(升级成ios7之后)
NSDate *toDate =[[NSDate alloc]initWithString:@"2000-10-10 12:00:00 -0500"];
用下面的方法替换
NSDateFormatter * formatter = [[NSDateFormatter alloc]init];
[forma...
分类:
其他好文 时间:
2014-05-21 15:07:58
阅读次数:
240
从谷歌地图接口取回数据包含回车换行符号,由于需要须把空格和换行符去掉,正常来说应该把字符串内的\n替换就可以了,后来试了一下不行。百度了一下,有人说换行应该是\r\n,也有人说需要换成\\n,众说纷纭,全部试过均告失败:
NSString *temp = [[NSString alloc]initWithData:xmlData encoding:NSUTF8StringEncoding...
分类:
其他好文 时间:
2014-05-21 06:54:08
阅读次数:
308