我正在創建一個應用程序,它有一個像圖片庫一樣的模塊。當我解析一個XML時,它會給出一些圖像,比如10,並顯示在表格的行中。現在,當從表中選擇一行時,在我的下一個視圖中,它應該在表格的行中顯示10個圖像的縮略圖。一行應該包含4個小圖像等等。圖片庫使用表格視圖
有什麼好的編程建議?
感謝
我正在創建一個應用程序,它有一個像圖片庫一樣的模塊。當我解析一個XML時,它會給出一些圖像,比如10,並顯示在表格的行中。現在,當從表中選擇一行時,在我的下一個視圖中,它應該在表格的行中顯示10個圖像的縮略圖。一行應該包含4個小圖像等等。圖片庫使用表格視圖
有什麼好的編程建議?
感謝
如果您不需要對這些單元格重新排序函數,那麼您可以通過繼承UITableviewCell實現,其中每個單元格包含4個按鈕。可以通過代表發送觸發內部消息。
更新:
自定義單元格例如:
@protocol MyCellDelegate <NSObject>
- (void)notifyCell:(MyCell *)cell didTouchupInside:(UIButton *)innerButton;
@end
@interface MyCell : UITableViewCell {
@private
// easy to understand button example
// you can use array or dictionary to manage your buttons.
UIButton *mButton1;
UIButton *mButton2;
UIButton *mButton3;
UIButton *mButton4;
// Other member variables.
}
@property (nonatomic, assign) id <MyCellDelegate> delegate;
- (id)initWithReuseIdentifier:(NSString *)reuseIdentifier delegate:(id)delegate;
@end
通過MyCellDelegate,客戶端就可以知道了myCell對象會發生什麼。
使用TTThumbsViewController從Three20:
https://github.com/facebook/three20/
教程:
http://mobile.tutsplus.com/tutorials/iphone/iphone-photo-gallery-three20/
感覺本土和究竟你需要的東西:
教程鏈接已停用。 – ThePower 2012-08-10 12:47:40
剛開始......... – Robin 2011-04-13 05:06:46
你是真的。 。 。 :D – Maulik 2011-04-13 05:10:05