
iPhone开发之基础UI
cash
这个作者很懒,什么都没留下…
展开
-
UILabeltext动态获取宽度
//昵称 UIButton *nickBut = [UIButton buttonWithType:UIButtonTypeCustom]; nickBut.userInteractionEnabled = YES; [nickBut setFrame:CGRectMake(0, 0, 100, 30)]; [nickBut addTarget:sel...原创 2011-09-27 16:55:27 · 99 阅读 · 0 评论 -
自定义UIWebView背景和每段首行缩进
自定义UIWebView背景和每段首行缩进让UIWebView背景透明的方法,如下。 web_about.backgroundColor = [UIColor clearColor];web_about.opaque = NO; 关键是在HTML里: //可以这样定义背景.NSMutableString *string = [[[NSMutableStrin...原创 2011-10-11 23:19:24 · 233 阅读 · 0 评论 -
iPhone的ckeckbox实现方法
-(void)checkboxClick:(UIButton *)btn{ btn.selected = !btn.selected;}- (void)viewDidLoad {UIButton *checkbox = [UIButton buttonWithType:UIButtonTypeCustom]; CGRect checkboxR...原创 2011-10-14 22:32:07 · 324 阅读 · 0 评论 -
UIImage保存到文件,PNG/JPEG自适应
UIImage保存到文件,PNG/JPEG自适应+ (BOOL)writeImage:(UIImage*)image toFileAtPath:(NSString*)aPath{ if ((image == nil) || (aPath == nil) || ([aPathisEqualToString:@""])) return NO...原创 2011-10-16 16:59:32 · 472 阅读 · 0 评论 -
从本地或网页加载图片到UIWebView里面
从本地或网页加载图片从本地加载图片NSString *boundle = [[NSBundle mainBundle] resourcePath];[web1 loadHTMLString:[NSString stringWithFormat:@""] baseURL:[NSURL fileURLWithPath:boundle]];从网页加载图片并让图片在规定长宽中缩小[...原创 2011-10-16 16:59:45 · 150 阅读 · 0 评论 -
从lazyTableImages官方例子学到的一些东西
最近做的项目要用到相关功能,于是下下来研究了下。发现在学到不少东西,记录下来方便以后查阅:1.多线程的使用例子里ParseOperation类继承自NSOperation,当rss的url请求完成后,新生成一个线程放到线程队列里,来执行xml的解析工作,这样不会影响主线程的一些后续操作,当解析完成后通知主线程,进行ui更新。这里需要注意的是,iphone开发中,在主线程...原创 2011-10-18 14:52:57 · 86 阅读 · 0 评论 -
MapKit计算两个经纬度之间的距离多少M
CLLocationManager *locmanager = [[CLLocationManager alloc]init];//先定义一个cllocationmanager的实例 [locmanager setDelegate:self]; //设置代理为本身 [locmanager setDesiredAccuracy:kCLLocationAccuracyBes...原创 2011-10-18 15:18:36 · 175 阅读 · 0 评论 -
iphone定位 基本知识
iphone定位 基本知识找到一个关于iphone定位的的资料,收藏一下其实使用iphone的定位系统开发软件是很简单的一件事,下面我们就来认识一下iphone的定位系统的使用。 1.Getting the User’s Current Location 获取用户当前位置。 获取位置的方式有三种:GPS, cell tower triangulation(蜂窝站点), ...原创 2011-10-20 10:10:37 · 249 阅读 · 0 评论 -
UIWebView解析加载的URL带中文字符
先自己创建一个UIWebView吧!NSString *query = [NSString stringWithFormat:@"http://www.baidu.com?q=苹果"]; NSString *strUrl = [query stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *...原创 2012-04-26 11:06:14 · 174 阅读 · 0 评论