1
我儘量繞一個點一個UITableView,我用這個IBAction爲只有半旋轉的UIView/UITableView的點周圍
CALayer *l = self.table.layer;
l.anchorPoint = CGPointMake(0,0);
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
CGAffineTransform rotate = CGAffineTransformMakeRotation(0.6);
table.transform = rotate;
[UIView commitAnimations];
工作,當我點擊所有表移動的按鈕冷杉另一比繞出轉角位置......問題是,在animation..If開頭的表移動到另一個位置,我把
CALayer *l = self.table.layer;
l.anchorPoint = CGPointMake(0,0);
在viewDidLoad中,當我打開應用程序的實現代碼如下是到另一個位置,但動畫是正確的,似乎l.anchorPoint將表移動到另一個位置......錯誤在哪裏?
原諒我,但如果我嘗試用你的代碼,我得到這個錯誤: 屬性「中心」不是類型的對象發現「的CALayer *」 我必須設置層或查看中心? – kikko088 2012-02-02 13:04:31
確定....不是「中心」,但位置,現在似乎工作! – kikko088 2012-02-02 16:08:27