2011-04-15 52 views
1

我有一張描述猴子頭像的圖片。我希望猴子的頭總是面朝上。當你轉動設備時,猴子的頭也會轉動,但是我希望儘管猴子的頭部旋轉,猴子的頭也不會轉動(就像指南針一樣)。如何讓圖像始終正視?

我該怎麼做?

+0

VOUS devez VOUS rendreà每個槽口問題闕這種情況下,我們可以採取一些措施來減輕這種情況的發生。 Aider les gensàobtenir la reconnaissance。 Si vous n'avez pas「accepter」lesréponsesen cochant les gens sont moins susceptibles d'aider。 Vous devez augmenter votre「accepter taux«aussi proche que possible de 100% – 2011-04-26 20:42:05

回答

0

如果你想跟隨設備,它將變成你必須跟蹤CLLocationManager。

但如果你只是想猴子直立從縱向到橫向(和它們的對立面)用戶transistions那麼也許UIInterfaceOrientation將這樣的伎倆:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return YES; 
} 
+0

我可以有關於CLLocation的詳細信息 – 2011-04-15 20:49:20

0
  1. 做旋轉動畫,this link可能會有所幫助。
  2. 遵循設備的方向是另一個故事...

可能涉及使用CLLocationManager :)指南針:

- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading

或更好,using gyroscope


製作肯定看Apple的文檔,therethere 也看看蘋果示例代碼:enter image description here

+0

我沒有finf的教程,我只是不能啓動 – 2011-04-16 12:19:42

+0

添加了一些蘋果鏈接,可能會有所幫助... – 2011-04-16 12:57:33

相關問題