UITableView动态单元格与UIScrollView多视图



这里的任何人都知道将dynamicCell加载到UITableViewController的好教程吗?CCD_2指向每个单元格的不同UIScrollView(以便在设备上查看完整的照片内容)。

我已经考虑这个问题有一段时间了,一时想不开!我可以获得一个UITableViewController作为指向ScrollView的静态单元格,但我似乎无法获得指向不同uiscrollviewuipagecontroller的dynamicCell!创建模型(Reciepe.h

@interface Recipe : NSObject
@property (nonatomic, strong) NSString *name; // name of recipe
@property (nonatomic, strong) NSString *imageFile; // image filename of recipe
@end

关于主视图,将ViewDidLoad命名为(ReciepeBookViewController.m

- (void)viewDidLoad {
[super viewDidLoad];
// Initialize table data
Recipe *recipe1 = [Recipe new];
recipe1.name = @"Egg Benedict";
recipe1.imageFile = @"egg_benedict.jpg";
Recipe *recipe2 = [Recipe new];
recipe2.name = @"Mushroom Risotto";
recipe2.imageFile = @"mushroom_risotto.jpg";
Recipe *recipe3 = [Recipe new];
recipe3.name = @"Full Breakfast";
recipe3.imageFile = @"full_breakfast.jpg";

Recipe *recipe4 = [Recipe new];
recipe4.name = @"Hamburger";
recipe4.imageFile = @"hamburger.jpg";

Recipe *recipe5 = [Recipe new];
recipe5.name = @"Ham and Egg Sandwich";
recipe5.imageFile = @"ham_and_egg_sandwich.jpg";
Recipe *recipe6 = [Recipe new];
recipe6.name = @"Creme Brelee";
recipe6.imageFile = @"creme_brelee.jpg";
Recipe *recipe7 = [Recipe new];
recipe7.name = @"White Chocolate Donut";
recipe7.imageFile = @"white_chocolate_donut.jpg";

Recipe *recipe8 = [Recipe new];
recipe8.name = @"White Chocolate Mocha";
recipe8.imageFile = @"starbucks_coffee.jpg";
Recipe *recipe9 = [Recipe new];
recipe9.name = @"Vegetable Curry";
recipe9.imageFile = @"vegetable_curry.jpg";

Recipe *recipe10 = [Recipe new];
recipe10.name = @"Instant Noodle with Egg";
recipe10.imageFile = @"instant_noodle_with_egg.jpg";
Recipe *recipe11 = [Recipe new];
recipe11.name = @"Noodle with BBQ Pork";
recipe11.imageFile = @"noodle_with_bbq_pork.jpg";

Recipe *recipe12 = [Recipe new];
recipe12.name = @"Japanese Noodle with Pork";
recipe12.imageFile = @"japanese_noodle_with_pork.jpg";

Recipe *recipe13 = [Recipe new];
recipe13.name = @"Green Tea";
recipe13.imageFile = @"green_tea.jpg";
Recipe *recipe14 = [Recipe new];
recipe14.name = @"Thai Shrimp Cake";
recipe14.imageFile = @"thai_shrimp_cake.jpg";
Recipe *recipe15 = [Recipe new];
recipe15.name = @"Angry Birds Cake";
recipe15.imageFile = @"angry_birds_cake.jpg";
Recipe *recipe16 = [Recipe new];
recipe16.name = @"Ham and Cheese Panini";
recipe16.imageFile = @"ham_and_cheese_panini.jpg";
recipes = [NSArray arrayWithObjects:recipe1, recipe2, recipe3, recipe4, recipe5, recipe6, recipe7, recipe8, recipe9, recipe10, recipe11, recipe12, recipe13, recipe14, recipe15, recipe16, nil];

}

当用户选择"Ham and Cheese Panini"时,我需要使用UIScrollController和带有图像阵列的PageController转到另一个视图控制器,当用户选择Angry Birds Cake时,使用UIScrollController和带有另一个图像阵列的PageController转到另一视图,依此类推。

有人能告诉我合适的解决方案或合适的教程

这里有一个关于如何使用动态单元格的教程,我希望它能有所帮助!

http://www.techotopia.com/index.php/Using_Xcode_Storyboards_to_Build_Dynamic_TableViews_with_Prototype_Table_View_Cells

相关内容

最新更新