I have a view hierarchy as below:
-UIScrollView
--UITableView
---UIView
all of my code in project is:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:scrollView];
UITableView *tableView = [[UITableView alloc] initWithFrame:scrollView.bounds];
tableView.delegate = self;
tableView.dataSource = self;
[scrollView addSubview:tableView];
UIView *tableSubView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 20)];
[tableView addSubview:tableSubView];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *idForCell = @"id";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:idForCell];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:idForCell];
}
cell.textLabel.text = [NSString stringWithFormat:@"%@",@(indexPath.row)];
return cell;
}
and my js code in Automation is:
var target = UIATarget.localTarget();
target.delay(2);
target.logElementTree();
finally I check element tree show in Trace Log by instruments,and the result is:
-UIATarget
--UIAApplication
---UIAWindow
----UIAScrollView
-----UIATableView
------UIATableCell
------UIATableCell
------UIATableCell
but I can't find the tableSubView
element, can anyone tell me the reason?TKS very much!