2011-08-04 24 views
2

我把NSTextView + NSImageView + NSMatrix + NSTextView放入NSScrollView中。而我這個滾動滾動視圖使用下面的代碼頂部 -如何強制重繪NSScrollView內的內容

NSPoint pointToScrollTo = NSMakePoint(0, NSMaxY([[singleScrollView documentView] frame]) - [[singleScrollView contentView] bounds].size.height); 
[[singleScrollView contentView] scrollToPoint: pointToScrollTo]; 
[singleScrollView reflectScrolledClipView: [singleScrollView contentView]]; 

但問題是,當它完成滾動到頂部的觀點得到弄糟..下面是截圖 -

enter image description here

我試圖強行使用這種沒有運氣重繪內容 -

[txtQTitle setNeedsDisplay:YES]; 
[viewOptions setNeedsDisplay:YES]; 
[singleScrollView setNeedsDisplay:YES]; 

不要任何人有任何想法,爲什麼這是造成又該如何解決呢?

編輯1 - 當我使用鼠標滾輪滾動視圖的singleScrollView的某些部分得到確定..這裏是這個截圖 - enter image description here

回答

5

嘗試用[[yourScrollView contentView] setCopiesOnScroll:NO]。我認爲,它應該解決你的問題。