[問題] Master-Detail的table移動highlight
不好意思問一下 版上前輩們.
已解決~~~ ^o^
我用xcode開Master-Detail範例(iPad的版本)
在Detail的頁面做了2顆按鈕,分別是上和下,
假設Master的Table那邊已經很多列可以選了。
想要達到"在Detail這邊按那兩顆按鈕,來控制Master(Table)那邊的光棒移動"
類似DropBox iPad版本那樣~
以我現在所知道的觀念,要動UI要是當前的主頁面,
難道要PUSH資料回去Master,動完光棒後,在PUSH回Detail嗎?
下面是我的用法,可是按按鈕還是沒有反應~!
我在 "DetailViewController.h" 追加這兩行
@class MasterViewController;
@property (strong, nonatomic) MasterViewController *masterViewController;
我在 "DetailViewController.m" 追加
#import "MasterViewController.h"
int select; ///設全域變數
- (IBAction)downBtn:(id)sender {
select=select+1;
NSLog(@"down-select=%d",select); ///check 數值
NSIndexPath *indexPathBlue;
indexPathBlue = [NSIndexPath indexPathForRow:select inSection:0];
[self.masterViewController.tableView selectRowAtIndexPath:indexPathBlue animated:YES scrollPosition:UITableViewScrollPositionMiddle];
}
想說為啥光棒會消失~~(卡超久
原來-1忘了改+1 -_-||a
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.135.166.170
※ 編輯: elver 來自: 220.135.166.170 (01/22 07:06)
討論串 (同標題文章)
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章