看板 [ MacDev ]
討論串[問題] 請教關於CollectionView上面的Button。
共 6 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓3(3推 0噓 6→)留言9則,0人參與, 最新作者darktt (小朱)時間11年前 (2014/08/08 07:17), 編輯資訊
0
0
1
內容預覽:
我是想到有另外一個作法,. 就跟這個差不多,. 全部作法是,將繼承一個 cell,將 button 的 target 與 action 指到 cell 自己本身,在 button 觸發的 method 中將 cell 自己用 delegate 傳回給上一層,. 這時候就可以用 cell.superv
(還有86個字)

推噓0(0推 0噓 1→)留言1則,0人參與, 最新作者lolicontrol (self)時間11年前 (2014/08/07 23:58), 11年前編輯資訊
0
0
1
內容預覽:
我做法跟你類似. UICollectionView *collection = (UICollectionView*) self.superview;. [collection indexPathForCell:self].row. 最後用 delegate 回傳值. --. 發信站: 批踢踢實
(還有79個字)

推噓2(2推 0噓 2→)留言4則,0人參與, 最新作者whitefur (白毛)時間11年前 (2014/08/07 22:11), 編輯資訊
0
0
2
內容預覽:
不要直接加在cell上. https://developer.apple.com/library/ios/documentation/uikit/reference/UICollectionViewCell_class/Reference/Reference.html. Do not directl
(還有337個字)

推噓1(1推 0噓 2→)留言3則,0人參與, 最新作者darktt (小朱)時間11年前 (2014/08/07 21:40), 編輯資訊
0
0
1
內容預覽:
不知道這個問題是否節解決了,. 不過我最近也正在用 CollectionView,. 所以可以做點幫忙。. 其實不用這樣子做,. 只要 button.superview 就是 cell 了,. 不過這要看 button 是否是直接加進 cell 或是 cell.contentView,. 不管哪一個
(還有380個字)

推噓2(2推 0噓 6→)留言8則,0人參與, 最新作者kiii210 (HelloWorld!)時間11年前 (2014/08/02 16:59), 11年前編輯資訊
0
0
1
內容預覽:
建立一個mp3名稱的array,順序跟你的textView要用的array一樣. -> @[@"song1",@"song2"];. 在cellForItemAtIndexPath裏面給每一個button一個編號. -> button.tag = indexPath.row. 每個button的se
(還有356個字)
首頁
上一頁
1
2
下一頁
尾頁