[問題] 如何更新custom view 的繪圖內容
使用:Xcode 3.1 (Leopard)
語言:Objective-C
問題敘述:
我在custom view上畫一個漸層色上去,可是只要視窗大小改變有蓋到我的custom
view 時,畫面會花掉= =
我看document裡面寫說 "Update a custom view to reflect changed content" 用:
"Send a setNeedsDisplayInRect: or setNeedsDisplay: message to the view"
可是我沒有要改變我畫的內容啊,只是希望畫面變正常,就是有update這樣.
不知道要用哪個method呢?
(不好意思我剛踏進蘋果程式設計,很多都不懂請多包涵> < )
第二個問題是,我在畫漸層的時候用NSGradient 的 drawInRect 這個方法,
它有個參數是NSRect,就是要畫漸層的地方吧?
那給它[customView rect] 和 [customView frame] 有什麼不同呢?
謝謝各位回答@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 219.70.112.56
※ 編輯: Jerrynet 來自: 219.70.112.56 (04/30 22:05)
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):