我見過添加分享按鈕的例子,但這些例子需要輸入要共享的文件名,例如:[controller addImage:[UIImage imageNamed:@"socialsharing-facebook-image.jpg"]];
,使用集合視圖中的不同項目時如何實現?收藏視圖上的分享按鈕
0
A
回答
0
- (UICollectionViewCell *)的CollectionView:(UICollectionView *)的CollectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { UICollectionViewCell *細胞= [的CollectionView dequeueReusableCellWithReuseIdentifier:@ 「sampleCell」 forIndexPath:indexPath];
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom ]; [btn setImage:[UIImage imageNamed:@"socialsharing-facebook-image.jpg"]
forState:UIControlStateNormal]; btn.tag = indexPath.row; [btn addTarget:self action:@selector(btn_Pressed)forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:btn]; return cell; }
您可以通過其標籤訪問特定按鈕...
相關問題
- 1. 按下收藏視圖中的隱藏按鈕
- 2. 在回收視圖中添加Facebook分享按鈕
- 3. Magento的分享收藏按鈕不起作用
- 4. 隱藏div中的Facebook分享按鈕
- 5. 分享按鈕分享所選圖像
- 6. cakephp/webtechnick的:分享按鈕隱藏像按鈕和評論
- 7. 分享按鈕
- 8. Facebook的Like按鈕的分享按鈕
- 9. Java swing上的Facebook分享按鈕
- 10. Android App的「分享圖像」按鈕
- 11. Facebook分享按鈕
- 12. Facebook分享按鈕
- 13. iPhone分享按鈕
- 14. facebook分享按鈕
- 15. Facebook分享按鈕
- 16. Twitter分享按鈕
- 17. Facebook分享按鈕
- 18. 共享按鈕和收藏夾在xcode的文件夾8
- 19. IBOutlet中收藏按鈕 -
- 20. 收藏夾按鈕withXMLHttpRequest
- 21. 隱藏/顯示單個項目上的視圖(圖像或按鈕)點擊回收站視圖列表
- 22. 在特定視圖的情況下隱藏部分按鈕
- 23. 收藏查看收藏按鈕按下迅速
- 24. Twitter分享按鈕動態URL分享
- 25. 分享Tweet按鈕的iFrame
- 26. GameScene中的分享按鈕
- 27. Twitter的卡分享按鈕
- 28. Android的分享按鈕
- 29. 分享按鈕的問題
- 30. 在https網站上分享按鈕