2013-11-21 34 views
0

添加子視圖我有一個的NSView(出口 - 的DetailsView),在該一個NSSplitView(出口 - detailsS​​piltView)和有在分割視圖中的兩個子視圖,並在這些子視圖有不同滾動視圖和表視圖。小牛問題:雖然上的NSView

NSView(detailsView) 
| 
NSSplitView(detailsSplitView) 
|   | 
NSView  NSView 
|     | 
NSScrollView  NSScrollView 
|     | 
NSTableView  NSTableVIew 

在一定條件下,我將在DetailsView控件和其他條件表視圖將被填充的一個錯誤觀點: 加載errorView的代碼如下:

[self.errorView setFrame:[self.detailsSplitView frame]]; 
[self.errorView setBackgroundColor:ERR_BG_COLOR]; 
[self.errorView setAlphaValue:0.85]; 
[self.detailsView addSubview:self.errorView]; 

其工作在Mountain Lion中完美無瑕,但在Maverick中,errorView會在表格視圖後面加載。 我甚至嘗試使用代碼

[tableView1 sendToBack]; 
[tableView2 sendToBack]; 
[self.detailsView addSubview:self.errorView positioned:NSWindowAbove relativeTo:self.detailsSplitView]; 

發回在意見表中,但仍然errorview正在加載中的tableview的後面。

+0

你試試我的答案? –

回答

1

我添加以下代碼addSubView方法之下,它的工作:

-------- 
[self.detailsView addSubview:self.errorView]; 
[self.errorView setWantsLayer:YES];