2
:정확히 CALayer의 display/drawRect 메소드에서 어떤 일이 발생해야합니까? 이러한 방법의 적절한 장소가 될 것입니다 어느 경우,
- 변경하려면 CAImageLayer
- 로 CATextLayer
- 로드의 텍스트 다른 이미지가 말해을 하위 레이어는 스스로
:정확히 CALayer의 display/drawRect 메소드에서 어떤 일이 발생해야합니까? 이러한 방법의 적절한 장소가 될 것입니다 어느 경우,
야 나는 방법 술에 취해있을 수 있습니다 ...하지만 난 당신이 사용할 수 있다고 생각 CAlayers
에서 NO의 drawRect 방법이 없습니다 drawInContext:
실제로 (꿀꺽 꿀꺽 마시는) CALayers를 끌어 들이지 만, 아무도 WW2 이후에는 할 수있는 사람이 없습니다.
디스플레이에 대해서는 전화하지 않아도 기본적으로 .contents
을 사용하여 설정 한 내용이 업데이트됩니다.
난 그냥 이런 .contents
뭔가를 ... 사용
[self.view setLayer:rearLayer];
[self.view setWantsLayer:YES];
rearLayer.frame = CGRectMake(gameBlah,gameBlah, 1024,768);
// note that we are dealing there with the mysteries of rearLayer positioning;
// it is measured by the SUPER layer of the layer in question!
// (indeed much as frame for the view is, if you think about it ..)
rearLayer.contents = (id)loadMacStylePng(@"spaceShip");
이 말 하나가 쓸 수있는 용기를 가지고 자신의
drawInContext:
...이 경우
, 그것은이라고합니다 (또는 밖으로 추출됩니다 자신. .. 또는 recalculated, 또는 뭔가)를 호출 할 때 displayAsNeeded
. (나는 displayAsNeeded:
에게 전화 할 필요가 전혀 없었습니다.)