[英]Detect rotation of subviews
我有一個包含幾個子視圖的視圖。 我可以使用UIRotationGestureRecognizer檢測並讓用戶僅旋轉一個子視圖或包含視圖。 但我希望能夠旋轉子視圖的任何正方形集合,如下所示:
初始狀態:
逆時針旋轉右上角正方形
到這里
我該如何實現這種行為? 我應該如何嵌套我的視圖層次結構?
任何指針表示贊賞:)
這是我要做的(偽代碼):
when rotation recognized:
create new_layer
new_layer.bounds = union_rect( frames of tiles to be rotated )
new_layer addSublayers:(tiles to be rotated)
while rotation in progress:
new_layer.transform = CATransform3DMakeRotation( angle, 0, 0, 1 )
when rotation complete:
(original view).layer addSublayers:(tiles to be rotated)
(tiles to be rotated) rearrange after rotation
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.