I am creating an app which is ha开发者_如何转开发ving a module some thing like a image gallery. When I parsed an XML it gives some number of images ,say 10 , and displayed in table's row. Now when select a row from table, in my next view it should display 10 image's thumbnails in a table's row. One row should contain 4 small image and so on.
any good programming suggestion ?
Thanks
Use TTThumbsViewController from Three20:
https://github.com/facebook/three20/
Tutorial:
http://mobile.tutsplus.com/tutorials/iphone/iphone-photo-gallery-three20/
Feels native and does exactly what you need:
If you don't need re-order function about those cells, then you can implement by subclassing UITableviewCell, in which each cell contains 4 buttons. The touch-up inside message can be send by delegate.
Update:
A custom cell example:
@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
Through MyCellDelegate, the client can know what happens on MyCell objects.
精彩评论