顯示具有 iOS 標籤的文章。 顯示所有文章
顯示具有 iOS 標籤的文章。 顯示所有文章

2012年5月3日

[iOS] UITextview 拉到最下方文字無法完整顯示問題

最近開發一個新聞閱讀軟體,裡面有些內容使用 UITextview 來呈現,呈現當然是沒有問題但是奇怪的是將卷軸拉到最下面後大概有兩行的內容會看不到,需要用手往上拉(捲動 scrollbar)才能看得到,經過一番查詢看來是 iOS 預設的呈現方式,我們必須自己插入一些空間讓文字能夠往上提一點而不會被隱藏起來,方法如下

UITextview 名稱為 : newsTextView

UIEdgeInsets contentInset = newsTextView.contentInset; //產生一個 UIEdgeInsets 物件
contentInset.bottom = 45.0; //下方空白空間,視需求增減
newsTextView.contentInset = contentInset; //設定 UITextview 的 contentInset 屬性

原始出處 : http://stackoverflow.com/questions/1582554/iphone-uitextview-leaves-room-for-2-lines-at-the-bottom

2012年4月9日

Xcode v4.2 升級到 v4.3.2 問題

前陣子因為 Apple 釋出 iOS 5.1, 所以開發工作也跟著出到 v4.3.2 版, 於是在閒暇的時候利用 Mac App store 把 Xcode v4.2 自動升級到 4.3.2. 升級完畢後點選 dock 上的 Xcode 圖示, 但是怎麼開起來還是 v4.2 版.... 後來利用 finder 搜尋 xcode 關鍵字, 發現在另一個地方也有一個 Xcode 執行檔, 原來 Mac App store 升級後不會自動替換掉 原本的 Xcode, 要自己拉出來才行阿!

2012年3月9日

[iOS] 程式進入背景後之支援類型

iOS 4.0 之後允許以下型態的用途進入背景執行

1. audio
2. Voice over IP
3. Background location
4. Push notifications
5. Local notifications
6. Task finishing - If your app is in mid-task when your customer leaves it, the app can now keep running to finish the task.
7. Fast app switching - All developers should take advantage of fast app switching, which allows users to leave your app and come right back to where they were when they left - no more having to reload the app.

一般都用 Task finishing, 系統會分配時間給你執行, 如果超過分配的時間 (預設是 600 秒 也就是10 分鐘), 系統會自動結束 process, 可利用下列語法查看, 系統分配備背景執行時間是多少
NSLog(@"Background remain time %f : ", [application backgroundTimeRemaining]);

參考來源 : iOS App Programming Guide: App States and Multitasking

2012年2月13日

iOS 好用 framework 或模組分享 (2012/9/12 更新)

開發 iOS app 時, 一些常用的功能都會有熱心的人已經開發好了, 如有找到適合的 framework 或 module 就不用重新自己造輪子囉~


搜集網站
http://www.cocoacontrols.com

iBook like reader
Leaves (https://github.com/brow/leaves)

書架
AQGridView (https://github.com/AlanQuatermain/AQGridView)
KKGridView (https://github.com/kolinkrewinkel/KKGridView)
GMGridView (https://github.com/gmoledina/GMGridView)
GSBookShelf (https://github.com/ultragtx/GSBookShelf)

PDF reader
VFR reader (https://github.com/vfr/Reader)

EPUB reader
AePubReader (https://github.com/fedefrappi/AePubReader)

eBook 製作工具 (HTML5 to iOS)
Baker Ebook http://bakerframework.com/

XML 解析
TBXML (http://www.tbxml.co.uk/TBXML/TBXML_Free.html)

JSON 解析
SBJson (http://stig.github.com/json-framework/)

Pull to reload
https://github.com/enormego/EGOTableViewPullRefresh

Three20 (Facebook App 使用)
http://three20.info/

CoverFlow 效果
Tapku (http://tapku.com/)
OpenFlow (http://apparentlogic.com/openflow/)

MGSplitViewController for iPad (比內建 UISplitViewController 更多功能)
http://mattgemmell.com/2010/07/31/mgsplitviewcontroller-for-ipad/

ASIHTTPRequest (上下載檔案, 非同步處理等)
http://allseeing-i.com/ASIHTTPRequest/


AFNetworking (一樣是網路連線的 wrapper)
https://github.com/AFNetworking/AFNetworking


ziparchive (壓縮/解壓縮 ZIP)
http://code.google.com/p/ziparchive/

QR Code
zxing (http://code.google.com/p/zxing/)

fmdb SQLite wrapper (簡化 SQLite 操作)
https://github.com/ccgus/fmdb

展開效果的 UIView
https://github.com/jwilling/JWFolders

ViewDeck (View 滑動效果)
https://github.com/Inferis/ViewDeck

ShareKit (快速製作 Facebook, twitter 分享功能)
http://getsharekit.com/

iCarousel (跑馬燈效果)
https://github.com/nicklockwood/iCarousel

iNotify (簡化 UINotification 類別)
https://github.com/nicklockwood/iNotify

TISwipeableTableView (滑動 tableview cell 產生新的 view)
https://github.com/thermogl/TISwipeableTableView

DTGridView (橫向 tableview cell)
https://github.com/danielctull/DTGridView

Kal - A calendar component for the iPhone (the UI is designed to match MobileCal)
https://github.com/klazuka/Kal

JHNotificationManager (A queue-able notification manager for custom view notifications)
https://github.com/jeffhodnett/JHNotificationManager

MBProgressHUD (客製化 alertview)
https://github.com/jk/MBProgressHUD

DejalActivityView (客製化 alertview)
http://www.dejal.com/developer/?q=developer/dsactivityview

YRDropdownView – A Polite UIAlertView Alternative for iOS (在上面會出現 UIAlertView)
http://buildinternet.com/2012/02/yrdropdownview-a-polite-uialertview-alternative-for-ios/

LIExposeController (linkedin style 的 view)
https://github.com/linkedin/LIExposeController

Cocoa plotting framework for OS X and iOS (畫折線圖、長條圖等)
http://code.google.com/p/core-plot/

MIMChart-Library (畫折線圖、長條圖等)
https://github.com/ReetuRaj/MIMChart-Library

翻頁效果1 (XBPageCurl)
https://github.com/xissburg/XBPageCurl#readme

翻頁效果2 (PaperStack)
http://api.mutado.com/mobile/paperstack/

iOS Boilerplate(A base template for iOS apps)
http://iosboilerplate.com/

ToolDrawer (伸縮的 toolbar)
https://github.com/aspitz/ToolDrawer

CMPopTipView (彈出 Tip 視窗功能)
https://github.com/chrismiles/CMPopTipView

wunderradio (Internet Radio SDK)
http://www.wunderradio.com/code.html

appirate (讓使用者增加評論 - review)
http://arashpayan.com/blog/2009/09/07/presenting-appirater/