以下のように書かれた直線がタッチされたか判定したいのですが、何か方法はないでしょうか。
線が太ければ太いほどタッチされやすくなるイメージです。
Xamarinの開発ですが、objective-cやswiftでも同じだと思いますので、言語は問いません。
c#
1CAShapeLayer shapeLayer = new CAShapeLayer(); 2UIBezierPath bezierPath = new UIBezierPath(); 3shapeLayer.Path = bezierPath.CGPath; 4shapeLayer.LineWidth = 10; 5bezierPath.MoveTo(new CGPath(0, 0)); 6bezierPath.AddLineTo(new CGPath(100, 100)); 7bezierPath.ClosePath();
◆環境
Visual Studio 2019
Xamarin 16.1
Xamarin.iOS 12.10
実機iPadのiOS 12.3
あなたの回答
tips
プレビュー