04 2011 档案

loadView vs viewDidLoad
摘要:The Problem:I was getting a white screen with no data in a UITableView on it in the iPhone simulator.The Solution:I had my initialization code for the array in the the "loadView" method and not the "viewDidLoad" methodExplanation:Don't read self.view in -loadView. Only set it 阅读全文

posted @ 2011-04-29 14:02 GaryGaryGary 阅读(102) 评论(0) 推荐(0)

Gradient 并且存为image
摘要:CGGradientRef 的基本步骤1 创建 CGGradient 对象, 提供一个 colorspace,提供一个数组,包含两个以上的颜色, 提供一个数组,包含两个以上的颜色所处位置, 提供一个数组包含前面两个数组中元素个数.2 调用CGContextDrawLinearGradient 或者 CGContextDrawRadialGradient ,提供参数 context, CGGradient 对象, drawing options, 开始和结尾的几何形状 (轴向渐变是两个点,径向渐变是圆心和半径).3 释放CGGradient。示例效果图创建一个图形上下文函数CGContextRe 阅读全文

posted @ 2011-04-28 17:23 GaryGaryGary 阅读(185) 评论(0) 推荐(0)

How to Make Custom Drawn Gradient Backgrounds in a Grouped UITableView with Core Graphics
摘要:In iPhone app design, it is important to find a balance between customization and familiarity. Many times, subtle differences are all you need to make yourself stand out from the crowd. While doing the Ambiance 3.0 redesign, I wanted something to make my list of content a little different than all t 阅读全文

posted @ 2011-04-28 14:41 GaryGaryGary 阅读(190) 评论(0) 推荐(0)

Custom colored UITabBar icons
摘要:Custom colored UITabBar iconsOctober 6, 2010 in iPhone & iPad by Tom Van HerrewegheOn the iPhone, there is no such thing as a menu. When you create an application, you will usually work with a drill-down structure called NavigationController, or with the TabBarController. The difference between 阅读全文

posted @ 2011-04-27 17:43 GaryGaryGary 阅读(144) 评论(0) 推荐(0)

Modal方式显示UIView
摘要:+ (void)showModal:(UINavigationController*)parentController{ static LoginController* sharedController; static UINavigationController *navigationController; if(!sharedController) { sharedController = [[LoginController alloc] initWithNibName:@"Login" bundle:nil modal:YES]; navigationControll 阅读全文

posted @ 2011-04-27 13:25 GaryGaryGary 阅读(176) 评论(0) 推荐(0)

creating and drawing on a new UIImage
摘要:creating and drawing on a new UIImage February 23, 2009 Someone asked me how to create a new image and draw another UIImage on it. Here’s the public answer, so everyone can benefit You can make a new image with using core graphics, but there is group of higher ... 阅读全文

posted @ 2011-04-26 17:35 GaryGaryGary 阅读(152) 评论(0) 推荐(0)

standard-ios-element-sizes
摘要:Have you memorized the heights of the status bar, navigation bar, tab bar, etc. for the iPhone? Yeah, me neither so here they are:Core Elements: Carrier Status bar – 20 px UINavigationBar – 44 px UITabBar – 49 px UISearchBar – 44 px UIToolBar – 44 pxData Input: UIPickerView – 216 px UIDatePicker – . 阅读全文

posted @ 2011-04-26 10:01 GaryGaryGary 阅读(124) 评论(0) 推荐(0)

iOS中使用RegexKitLite来试用正则表达式
摘要:iOS中使用RegexKitLite来试用正则表达式 收藏 准备工作,下载RegexKitLite软件包,解压后有2个文件,需要加载到project中。然后还要加载framework libicucore.dylib,因为RegexKitLite是调用这个里面的API,苹果规定过不能使用私有的api和没有发布的api。实际上RegexKitLite对NSString做了扩展,目前只支持NSString,对我来说也够了...基本使用的例子(更多信息参看官方文档)1.NSString*searchString=@"Thisisneat.";NSString*re... 阅读全文

posted @ 2011-04-21 14:19 GaryGaryGary 阅读(146) 评论(0) 推荐(0)

用坐标计算里程
摘要:用坐标计算里程代码一private const double EARTH_RADIUS=6378.137; private static double rad(double d) { return d*Math.PI/180.0; }public static double GetDistance(double lat1,double lng1,double lat2,double lng2) { double radLat1=rad(lat1); double radLat2=rad(lat2); double a=radLat1-radLat2; double b=rad(lng1)-.. 阅读全文

posted @ 2011-04-20 16:01 GaryGaryGary 阅读(762) 评论(0) 推荐(0)

计算两个地理坐标之间的距离
摘要:计算两个地理坐标之间的距离 Posted on 26/09/2010 by James Tang 下面这个函数(PHP实现)用于计算两个地理坐标之间的距离,主要用于处理源自Google地图的坐标数据。验证数据:[48.856667, 2.350987], [38.895113, -77.036366]验证结果:6172.4281776242KM01/**02* Calculate the distance between two coordinates.03* @param array $s, array(float:latitude, float: longitude)04... 阅读全文

posted @ 2011-04-20 15:59 GaryGaryGary 阅读(629) 评论(0) 推荐(0)

移动设备界面开发: 专业Android, iPhone, iPad, Palm Pre设计工具箱
摘要:http://uiclub.blogbus.com/logs/73239992.html用性测试,更关注设计创新!] <<Android UI Design Patterns | 首 页 | 触摸手势参数指南>>2010-08-17移动设备界面开发: 专业Android, iPhone, iPad, Palm Pre设计工具箱 - [设计资源]版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://uiclub.blogbus.com/logs/73239992.html从事移动终端设计的朋友,一定对不同平台的设计规范有了解。实际在终端平台上开发软 阅读全文

posted @ 2011-04-20 10:18 GaryGaryGary 阅读(155) 评论(0) 推荐(0)

iPhone、iPad 网页抓取工具源码分享
摘要:http://www.cocoachina.com/downloads/video/2010/0817/2020.htmliPhone、iPad 网页抓取工具源码分享时间: 2010-08-17 17:20 CocoaChina 会员gycfz分享了iXpather、iRegex2个网页抓取工具的源代码,对于希望在 iPhone、iPad 应用里嵌入抓取网页内容功能的开发者们一定有所帮助。 截图 附件下载 iXpather.zip (585 K) iRegex.z CocoaChina 会员“gycfz”分享了... 阅读全文

posted @ 2011-04-19 14:58 GaryGaryGary 阅读(299) 评论(0) 推荐(0)

我要搭高鐵Lite版突破10萬次下載及我們從台灣App Store所學到的一些小事
摘要:我要搭高鐵Lite版突破10萬次下載及我們從台灣App Store所學到的一些小事二月 23, 2011由 Olli Wang 發表 App, App Store, 新聞, Ollix, 台灣, 我要搭高鐵, iPhone 11 個回應 English, 正體中文, 简体中文 TweetShare1感謝所有愛用者的支持,我們的第一個iPhone app「我要搭高鐵」Lite版自上架七個月來全球已經突破10萬次下載了,其中台灣約佔總下載數的93%。我知道這數字跟大家常常在新聞上看到的成功故事裡所提的天文數字仍有很大的一段差距,但考量到這個app幾乎是... 阅读全文

posted @ 2011-04-19 14:45 GaryGaryGary 阅读(126) 评论(0) 推荐(0)

為什麼軟體工程無法估算時間?
摘要:而要管理「生產力」,一個現代化的軟體開發團隊,我認為有以下的幾個好工具可以用:Pair Programming (兩人小組) — 一個人寫程式常常會有盲點,兩個人一起則可以看到對方遺漏的地方。更重要的是兩個人都會從對方身上學到很多知識和技巧,彼此都會成長。而當兩個人都了解一組程式碼,日後的維護也有了兩個選擇,不會因為一個人請假、離職,這些 code 就變成孤兒。記得給他們兩個鍵盤,實務上這會比鍵盤移來移去有效率。Daily Stand-Up Meeting (每日早會) — 每天早上固定開一個快速早會,全部人都站著,每個人依序報告昨天的進度,碰到的問題,和溝通彼此程式間該如何傳遞資料。這讓團隊 阅读全文

posted @ 2011-04-19 10:38 GaryGaryGary 阅读(90) 评论(0) 推荐(0)

iPhone 尺寸
摘要:ElementSize (in pixels)Window (including status bar)320 x 480pxStatus Bar(How to hide the status bar)20 pxView inside window(visible status bar)320 x 460Navigation Bar44 pxNav Bar Image /Toolbar Imageup to 20 x 20 px (transparent PNG)Tab Bar49 pxTab Bar Iconup to 30 x 30 px (transparent PNGs)Text Fi 阅读全文

posted @ 2011-04-15 17:33 GaryGaryGary 阅读(168) 评论(0) 推荐(0)

创建关联的UIPickerView 显示省市
摘要:创建关联的UIPickerView 显示省市 iPhone 2010-03-28 12:42:57 阅读225 评论2 字号:大中小订阅 //// DependentComponentPickerViewController.m// Pickers//// Created by Jeff LaMarche on 7/7/08.// Copyright 2008 __MyCompanyName__. All... 阅读全文

posted @ 2011-04-15 17:18 GaryGaryGary 阅读(179) 评论(0) 推荐(0)

改UISwitch上的text
摘要:改UISwitch上的text 为要更改Text的UISwitch建立IB连接:例如mySwitch,在代码中改变文字: ((UILabel *)[[[[[[self.mySwitch subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex:0]).text = @"Foo"; ((UILabel *)[[[[[[self.mySwitch subviews] lastObject] subviews] objectAtIndex:2] subviews] objectAtIndex: 阅读全文

posted @ 2011-04-15 17:00 GaryGaryGary 阅读(162) 评论(0) 推荐(0)

iPhone常用code
摘要:iPhone常用code 一月 30, 2011 修改navigation bar的button样式:UIButton *BackBtn = [[UIButton alloc] initWithFrame:CGRectMake(0.0, 100.0, 62.0, 29.0)];[BackBtn setImage:[UIImage imageNamed:@"BackBtn.png"] forState:UIControlStateNormal];[BackBtn addTarget:self action:@selecto... 阅读全文

posted @ 2011-04-15 16:55 GaryGaryGary 阅读(195) 评论(0) 推荐(0)

Phone起步-2:iPhone常用控件、UIActionSheet、UIAlertView
摘要:http://www.cnblogs.com/elfsundae/archive/2010/11/11/1874486.html一、UILabel二、UIButton常用事件:Touch Up Inside三、UITextField常用属性:Text:要显示的文本。Placeholder:指定将要在文本字段中以灰色显示的占位符文本。Clear When Editing Begins:用户触摸此字段时是否删除字段中的值。Text Input Traits:文本输入特征。四、UIImageView常用属性:image:指定图像文件Mode:图像在视图内部的对齐方式以及是否缩放图像以适应视图。选择任 阅读全文

posted @ 2011-04-02 16:47 GaryGaryGary 阅读(134) 评论(0) 推荐(0)

导航