我正在開發一個IOS應用程序。我使用Facebook AsyncDisplayKit庫。我想一個按鈕ASNodeCell卜我「變量‘節點’當塊中捕獲的初始化。我如何添加的UIButton或ASNodeCell UIWebView的控制。請幫我使用AsyncDisplayKit添加自定義按鈕
dispatch_queue_t _backgroundContentFetchingQueue;
_backgroundContentFetchingQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
dispatch_async(_backgroundContentFetchingQueue, ^{
ASDisplayNode *node = [[ASDisplayNode alloc] initWithViewBlock:^UIView *{
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
[button sizeToFit];
node.frame = button.frame;
return button;
}];
// Use `node` as you normally would...
node.backgroundColor = [UIColor redColor];
[self.view addSubview:node.view];
});
https://github.com/liaogang/ASPhotoBrowser.git,這個演示可能有幫助 – liaogang 2016-01-08 07:45:49