因為 iOS 上面的 UILabel 元件不支援 Vertical alignment (top, center, bottom)
那麼我們要怎麼做呢?
可以參考這個討論串:
http://discussions.apple.com/message.jspa?messageID=10270072#10270072
2011年4月14日 星期四
2011年4月11日 星期一
[UILabel] 在字數過多的時候,顯示「...」
TableView在呈現資料時
我們可以自己設計想要的 TableViewCell 樣式
假設 Cell 裡面我們放置一個 UILabel 顯示資料
當字數過長時,想要用 ... 顯示
那該怎麼做呢?
可以在下面這個地方做一些處理
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
處理如下(假設超過30個字要顯示...沒有特別考慮中文或英文的情況...單純舉例):
我們可以自己設計想要的 TableViewCell 樣式
假設 Cell 裡面我們放置一個 UILabel 顯示資料
當字數過長時,想要用 ... 顯示
那該怎麼做呢?
可以在下面這個地方做一些處理
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
處理如下(假設超過30個字要顯示...沒有特別考慮中文或英文的情況...單純舉例):
[UITableView] 修改 TableView 的 Section 之間的 Spacing
當 TableView 的 Style 為 UITableViewStyleGrouped
就可以 Section 的形式來呈現資料
如果想要調整各 Section 之間的間隔
可以參考下面幾個函式進行修改:
就可以 Section 的形式來呈現資料
如果想要調整各 Section 之間的間隔
可以參考下面幾個函式進行修改:
2011年3月29日 星期二
[UITabBarController] 將TabbarController 隱藏
TabbarController
|____ NavigationController
|_____________ViewController
當 NavigationController push 頁面後,
有些頁面可能想要隱藏下方的 Tab bar,
可以用下面的方式進行處理:
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:ViewPage animated:YES];
self.hidesBottomBarWhenPushed = NO;
|____ NavigationController
|_____________ViewController
當 NavigationController push 頁面後,
有些頁面可能想要隱藏下方的 Tab bar,
可以用下面的方式進行處理:
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:ViewPage animated:YES];
self.hidesBottomBarWhenPushed = NO;
2011年3月21日 星期一
[UITableView] 在 editing mode 選擇 Table cell 的作法
在 TableView 的 instance 產生後,
可以將 allowsSelectionDuringEditing 這個 property 設為 YES,
這樣在 editing mode 就仍然可以讓 didSelectRowAtIndexPath 正常運作
可以將 allowsSelectionDuringEditing 這個 property 設為 YES,
這樣在 editing mode 就仍然可以讓 didSelectRowAtIndexPath 正常運作
2011年3月17日 星期四
取消 Visual Studio 2010 自動 Check Out 的功能
Visual Studio 2010 & TFS Client 於 Check Out 的設定:
為了避免不小心按到鍵盤的某個按鍵,然後自動 Check out server 上面的 source code ,
進而對檔案做了無心的更動,
可以設定 Visual Studio 的一些設定避免這種情況發生:
(1) Tools -> Options -> Source Control -> Environment
將 Checked-in 的 Editing 設為 Do nothing
(2) 針對每個 Solution 要分別設定的:
File -> Source Control -> Change Source Control
將所有的項目 Unbind
為了避免不小心按到鍵盤的某個按鍵,然後自動 Check out server 上面的 source code ,
進而對檔案做了無心的更動,
可以設定 Visual Studio 的一些設定避免這種情況發生:
(1) Tools -> Options -> Source Control -> Environment
將 Checked-in 的 Editing 設為 Do nothing
(2) 針對每個 Solution 要分別設定的:
File -> Source Control -> Change Source Control
將所有的項目 Unbind
Visual Studio 2010 + Vim
今年過年後,我在工作方面轉換跑道,
未來主要是 Focus on iPad/iPhone programming, C#/Silverlight programming,
以前用 Vim 習慣後,
hjkl 實在是抹之不去啊~
可想而知,雖然知道 XCode, Visual Studio 等整合開發環境的方便性,
但還是忘不了 Vim 的好啊!
因此,冒出了想在 Visual Studio 2010 上面使用 Vim 的念頭~
經過 Google 之後,發現有這個想法的人很多 ^^
廢話不多說~請參考下面網址吧!
http://kkbruce.blogspot.com/2010_12_01_archive.html
http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329/
http://www.viemu.com/
2011/4/17
附註:Ctrl + Shift + F12 可以 Enable/Disable VSVim 這個功能
未來主要是 Focus on iPad/iPhone programming, C#/Silverlight programming,
以前用 Vim 習慣後,
hjkl 實在是抹之不去啊~
可想而知,雖然知道 XCode, Visual Studio 等整合開發環境的方便性,
但還是忘不了 Vim 的好啊!
因此,冒出了想在 Visual Studio 2010 上面使用 Vim 的念頭~
經過 Google 之後,發現有這個想法的人很多 ^^
廢話不多說~請參考下面網址吧!
http://kkbruce.blogspot.com/2010_12_01_archive.html
http://visualstudiogallery.msdn.microsoft.com/59ca71b3-a4a3-46ca-8fe1-0e90e3f79329/
http://www.viemu.com/
2011/4/17
附註:Ctrl + Shift + F12 可以 Enable/Disable VSVim 這個功能
訂閱:
文章 (Atom)
