看板
[ MacDev ]
討論串[問題] 請教關於CollectionView上面的Button。
共 6 篇文章
內容預覽:
我是想到有另外一個作法,. 就跟這個差不多,. 全部作法是,將繼承一個 cell,將 button 的 target 與 action 指到 cell 自己本身,在 button 觸發的 method 中將 cell 自己用 delegate 傳回給上一層,. 這時候就可以用 cell.superv
(還有86個字)
內容預覽:
我做法跟你類似. UICollectionView *collection = (UICollectionView*) self.superview;. [collection indexPathForCell:self].row. 最後用 delegate 回傳值. --. ※ 發信站: 批踢踢實
(還有79個字)
內容預覽:
不要直接加在cell上. https://developer.apple.com/library/ios/documentation/uikit/reference/UICollectionViewCell_class/Reference/Reference.html. Do not directl
(還有337個字)
內容預覽:
不知道這個問題是否節解決了,. 不過我最近也正在用 CollectionView,. 所以可以做點幫忙。. 其實不用這樣子做,. 只要 button.superview 就是 cell 了,. 不過這要看 button 是否是直接加進 cell 或是 cell.contentView,. 不管哪一個
(還有380個字)
內容預覽:
建立一個mp3名稱的array,順序跟你的textView要用的array一樣. -> @[@"song1",@"song2"];. 在cellForItemAtIndexPath裏面給每一個button一個編號. -> button.tag = indexPath.row. 每個button的se
(還有356個字)