作者elver (elver)
看板MacDev
标题[问题] Master-Detail的table移动highlight
时间Mon Jan 21 01:15:03 2013
不好意思问一下 版上前辈们.
已解决~~~ ^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)