目前分類:技巧篇 (20)

瀏覽方式: 標題列表 簡短摘要

實作 TableView Section 展開/收合

 from http://blog.yslin.tw/2011/09/tableview-section.html
iPhone中的UITableViewController變化真的很多!
最近剛好需要實作展開/收合的功能,效果如圖所示:

zer931 發表在 痞客邦 留言(0) 人氣()

本文引用自changyy - iOS 開發筆記 - 國曆轉農曆計算 (Chinese Lunar Calendar)

lunar-2013-06

把玩一下 NSCalendar ,發現他可以計算咱們華人常用的農曆日期耶!完整文件 iOS Developer Library - Date and Time Programming Guide

程式碼:

zer931 發表在 痞客邦 留言(0) 人氣()

UIView 同時移動、旋轉、放大的作法

from http://servinggear.blogspot.tw/2012/02/uiview.html

 
在orderGear裡有個我很喜歡的動畫效果,就是如果點選左手邊的菜色相片,它就會移動到畫面的中央並放大、轉正。
點選前:

zer931 發表在 痞客邦 留言(0) 人氣()

GCD介绍(一): 基本概念和Dispatch Queue

zer931 發表在 痞客邦 留言(0) 人氣()

iOS 基于键盘的编程所需技巧

from http://blog.csdn.net/zhangao0086/article/details/7063733

IOS官方文件 可搜尋範例 KeyboardAccessory

首先,你得监听键盘的事件,最基本的两个事件:

zer931 發表在 痞客邦 留言(0) 人氣()

- (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view;

根据指定view参照物,转换点的坐标
比如在一个View上一个Button,在button上有个点,相对button的坐标知道了,想知道这个点在这个View上的坐标,就可以用这个API去转换


zer931 發表在 痞客邦 留言(0) 人氣()

如果要在其他class存取 XXXAppDelegate內的變數有兩種做法

 

一.

1在XXXAppDelegate的變數設定@property

zer931 發表在 痞客邦 留言(0) 人氣()

饼状图的绘制

from http://www.winddisk.com/2012/06/17/piechart/

学习开源代码BNPieChart中饼状图的绘制流程,目的是绘制如下图形。

zer931 發表在 痞客邦 留言(0) 人氣()

TableView Cell 使用方法dequeueReusableCellWithIdentifier

從xib或storyboard 使用自定cell

 

- (UITableViewCell *)tableView:(UITableView *)tableView  cellForRowAtIndexPath:(NSIndexPath *)indexPath

zer931 發表在 痞客邦 留言(0) 人氣()

UITableView cell自訂視圖中插入Table實現複雜介面

from http://fecbob.pixnet.net/blog/post/35423964

最近專案中需要實現如下圖所示的效果:
image_thumb8.png  

zer931 發表在 痞客邦 留言(0) 人氣()

Iphone在table cell中添加自訂佈局view

from http://fecbob.pixnet.net/blog/post/35424051

在android開發listView中,每一行的清單可以通過相應的xml定義視圖。在iphone開發中,tableView也提供了通過nib自訂視圖的解決方案。這就使開發者能夠完成相當複雜的介面佈局。

 

下麵介紹table中添加自訂的table cell。實現的效果如下:

zer931 發表在 痞客邦 留言(0) 人氣()

NSMutableArray Sort

 from http://sorrowslee.blogspot.tw/2012/07/nsmutablearray-nsstring-sortorder-array.html

今天來分享一下NSMutableArray的排序方式
NSString *sortOrder = @"AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz_0123456789";
             
            [array sortUsingComparator:^NSComparisonResult(id obj1, id obj2)
             {
                 char char1 = [(NSString *)obj1 characterAtIndex: 0];
                 char char2 = [(NSString *)obj2 characterAtIndex: 0];
                  
                 int index1;
                 for (index1 = 0; index1 < sortOrder.length; index1++)
                     if ([sortOrder characterAtIndex: index1] == char1)
                         break;
                  
                 int index2;
                 for (index2 = 0; index2 < sortOrder.length; index2++)
                     if ([sortOrder characterAtIndex: index2] == char2)
                         break;
                  
                 if (index1 < index2)
                     return NSOrderedAscending;
                 else if (index1 > index2)
                     return NSOrderedDescending;
                 else
                     return [(NSString *)obj1 compare: obj2 options: NSCaseInsensitiveSearch];
             }];

zer931 發表在 痞客邦 留言(0) 人氣()

iOS 5 的 UIKit 粒子系統

from http://itouchs.blogspot.tw/2012/07/ios-5-uikit.html 
since: 2012/07/03
update: 2012/07/10

reference: 

zer931 發表在 痞客邦 留言(0) 人氣()

Accelerometer / 加速器 / 重力控制器 / 水平儀的基本使用方法

From: http://furnacedigital.blogspot.tw/2010/11/accelerometer.html
 
 
 

zer931 發表在 痞客邦 留言(0) 人氣()

From http://www.ericd.net/2009/05/iphone-nstimer-and-that-thing-called.html

 

Tuesday, May 12, 2009

 iPhone: NSTimer and that thing called userInfo

Tuesday, May 12, 2009   

 
As I am implementing some stuff, I had reason to send along some information to a NSTimer's "onComplete" method. Every example online I've seen recently using NSTimer sets the userInfo property to nil. Not very useful for me to learn from. After a little banter on an email list, I understand how this thing works.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

zer931 發表在 痞客邦 留言(0) 人氣()

From http://furnacedigital.blogspot.com/2011/12/magnetometer.html

取得指南針 / 羅盤 / Magnetometer 數值的方法

 
 

目前大部份的 iOS 裝置都有支援 Magnetometer 指南針的功能,透過 Core Location 的Framework 就可以輕易取得 Magnetometer 當前的數值(角度),請看以下程式碼示範。

zer931 發表在 痞客邦 留言(0) 人氣()

From http://fecbob.pixnet.net/blog/post/35423944

在 iOS 應用中使用 GPS大致分下麵兩步:1、添加 CoreLocation.framework;2、生成 CLLocationManager 測量位置。 測試代碼如下: // LocationViewCtrl.h #import UIKit/UIKit.h #import CoreLocation/CoreLocation.h @inter

在 iOS 應用中使用 GPS大致分下麵兩步:1、添加 CoreLocation.framework;2、生成 CLLocationManager 測量位置。

 

zer931 發表在 痞客邦 留言(0) 人氣()

FROM http://pingguohe.net/2011/08/21/keyboard-show/

正确推出键盘和消失的方法

在iOS5中苹果对中文输入法进行了升级。在拼音模式下,键盘的上方增加了一条候选栏。在不少程序中键盘弹出后,拼音输入法的候选栏遮住了输入框。
造成这个问题的原因是因为,很多程序在处理键盘弹出和隐藏的的时候,过分简单的把键盘的高度写成了一个常量。然后把输入框推高了一个定死的高度。
在iOS5中这个方法就行不通了,如果把view推高的高度设成是中文键盘的高度。那么在英文输入状态下。键盘和其他的view之间就会流出一段候选栏高度的空白。

zer931 發表在 痞客邦 留言(0) 人氣()

FROM http://hi.baidu.com/%B0%D9ii%D6%AAi%B5%C0/blog/item/98a9d6cfe53ded440eb3457b.html

CustomCell 自适应高度+label自动换行+ UITextView 根据内容自动调整高度
2011/03/26 11:48

CustomCell 自适应高度

zer931 發表在 痞客邦 留言(0) 人氣()

NSPredicate利用一个数组的数据来过滤另一个数组  

 

zer931 發表在 痞客邦 留言(0) 人氣()