2015-01-03 22 views
0

我使用鈦合金來構建iOS應用程序。我遇到了一個非常令人沮喪的問題,我現在已經陷入了很多困境。使用鈦合金翻轉動畫的錯誤

一旦用戶登錄,我的目標是讓登錄窗口動畫(翻轉)到儀表板窗口。這個效果很好,除了這個bug之外。登錄導航頂部欄似乎在播放器儀表板欄向下跳到正確位置之前顯示一秒。

它看起來像這樣,直到翻轉動畫完成: It looks like this until the animation completes.

在動畫完成它跳轉到這一點: After animation completed

儀表板頁是TabGroup,類似於此,而初始選項卡的標題是「玩家」:

<TabGroup> 
    <Tab icon="player_icon.png"> 
     <Window id="playerTab" title="Player"/> 
    </Tab> 
</TabGroup> 

登錄控制器是一個登錄窗口和註冊風NavigationWindow流。

在成功提交登錄表單,我創建索引控制器(儀表盤):

Alloy.createController('index', { animate: true, loginSuccess: true }); 

它具有初始化代碼如下所示:

if (!AppData.isLoggedIn() && !args['loginSuccess']) { 
    // Splash contains the register/login forms 
    Alloy.createController('splash'); 
} else { 
    // Check if the user is logging in or resuming previous state 
    if(args['animate']) { 
     $.index.open({ transition: Ti.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT }); 
    } else { 
     $.index.open(); 
    } 
} 

沒有人有任何想法爲什麼這個錯誤可能會發生?我感謝任何幫助!

謝謝!

回答

1

想通了!原來翻轉動畫並沒有考慮狀態欄高度,直到動畫結束,所以我爲TabGroup設置了一個20的初始頂邊距,並在動畫完成後去除了邊距。

現在很好用!