문제

I have two UIViews, each one has draw a car(vectorgraph), now if a car(A) behind another car(B), then I want the overlaps in A be dashed. the car was drawn by UIBezierPath, I want the overlaps in A's path become dashed, how can I do this? Thank you for your helping!

도움이 되었습니까?

해결책

I don't think there is any way to do this automatically. You would need to calculate the bounding rectangle of the intersection of the 2 views, and then manually parse the path of car A into 2 parts, the part that's covered and the part that's not, and draw the covered part using dashed lines.

This is original development that you would have to do yourself.

Erica Sadun's outstanding "iOS Developer's Cookbook" series has a recipe that shows how to parse a bezier path segment by segment. Figuring out the portion of the path that is inside the intersection range will involve some tricky programming.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top