我剛剛在iPhone 5上測試了我的第一款Flex移動應用程序,但由於我認爲它不適合新的4英寸屏幕,是否有人知道這是否可行?的Flex 4.6 SDK)適用於iPhone 5屏幕的Flex移動應用程序
回答
這是一個小傻瓜,但它的工作原理。首先,確保你有the latest AIR SDKinstalled in your Flash Builder eclipse plug in directory,這將確保下面的技巧實際工作。
現在,轉到您的項目主要MXML文件(如果您正在構建基於視圖的項目,該項目將成爲ViewNavigatorApplication類實例)。在打開的ViewNavigatorApplication標籤中,爲splashScreenImage設置一個值爲「@Embed('[email protected]')的屬性「它應該是確定這樣的事情...
<s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
firstView="views.myFirstView"
splashScreenImage="@Embed('[email protected]')">
現在,做一個640瓦特X 1136h閃屏PNG並將其命名爲 「[email protected]」。將該映像文件放在項目的根目錄(可能是您的「src」目錄)中。編譯你的iPhone 5目標,瞧!
事實證明,AIR將查找較大的啓動屏幕文件作爲您指定的iPhone 5屏幕尺寸的指標。在app.xml文件中沒有設置。沒有代碼中的屬性。就是那個splashScreenImage文件的名字。
這很明顯,是吧?
只要爲不同的屏幕尺寸創建不同的佈局Rich Tretola有一本很棒的和便宜的書,帶有Flex 4.5的iOS應用程序,討論使用@media查詢進行響應式設計。 His website has an excerpt that might help ...但這本書便宜,實用且快速閱讀。
我沒有將Embed信息添加到應用程序splashScreenImage中(因爲我使用的組件是爲不同的分辨率提供不同的圖像),但我確實將「[email protected]」圖像放在src目錄中,並構建了應用程序與iOS 6.1 SDK和正確顯示使用iPhone 5上的全分辨率。 所以希望這對於那些使用像我這樣的組件,而不必建立一個應用程序來測試第一等有用。我用Flash Builder 4.7和AIR 3.8。 – Tyler
可以動態改變開機畫面是這樣的:
<?xml version="1.0" encoding="utf-8"?>
<s:SplashScreenImage xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
<![CDATA[
override public function getImageClass(aspectRatio:String, dpi:Number, resolution:Number):Class
{
var x:Number = Capabilities.screenResolutionX;
var y:Number = Capabilities.screenResolutionY;
// HTC
if ((x == 480) && (y == 800)) return img_480_800.source;
// iPhone 5
if ((x == 640) && (y == 1136)) return img_1080_1920.source;
// iPhone 4
if ((x == 640) && (y == 960)) return img_640_960.source;
// Samsung galaxy s3
if ((x == 720) && (y == 1280)) return img_720_1280.source;
// Samsung galaxy s4
if ((x == 1080) && (y == 1920)) return img_1080_1920.source;
// Default
return img_1080_1920.source;
}
]]>
</fx:Script>
<s:SplashScreenImageSource id="img_480_800" source="@Embed('Default_480_800.png')"/>
<s:SplashScreenImageSource id="img_640_960" source="@Embed('[email protected]')"/>
<s:SplashScreenImageSource id="img_720_1280" source="@Embed('Default_720_1280.png')"/>
<s:SplashScreenImageSource id="img_1080_1920" source="@Embed('[email protected]')"/>
</s:SplashScreenImage>
....
splashScreenImage="DynamicSplashScreen"
- 1. iPhone 5的屏幕適應
- 2. 適用於iPhone的Flex應用程序
- 3. 如何遷移iPhone 5屏幕分辨率的應用程序?
- 4. 適用於iPhone應用程序的啓動屏幕(啓動圖像)vs圖標
- 5. 僅適用於平板電腦的Flex移動應用程序
- 6. #define適用於不同的屏幕尺寸 - iPhone 4和iPhone 5
- 7. 屏幕不啓動iphone應用程序
- 8. 使iphone 3應用適合iPhone 5 4英寸屏幕
- 9. 適用於iPhone的移動OCR引擎應用程序
- 10. 如何創建iPhone應用程序是適用於iPhone 4和5的屏幕尺寸共通性
- 11. sumbit應用程序僅適用於iPhone 5/5s和iPhone 6/6 +
- 12. 應用程序不適應屏幕
- 13. 適用於移動應用程序的LightSwitch HTML應用程序
- 14. 是否需要爲iPhone 5的屏幕修改應用程序?
- 15. 如何製作適用於iphone 5和4s的應用程序
- 16. 適用於iPhone 5及以上版本的新應用程序
- 17. 屏幕旋轉不適用於iOS 5但適用於iOS 6
- 18. iPhone 5應用程序(4英寸屏幕)
- 19. 如何將Cocos2d應用程序縮放到iPhone 5屏幕?
- 20. iphone應用程序屏幕卡在iOS 5上
- 21. 應用程序與iPhone 5屏幕尺寸兼容性
- 22. 適用於Windows Phone的鎖定屏幕應用程序
- 23. 切換屏幕旋轉僅適用於我的應用程序
- 24. 適用於Android應用程序的黑色屏幕
- 25. 適用於其他屏幕尺寸的應用程序
- 26. iphone:在基於視圖的應用程序中,如何從第4個屏幕移動到第1個屏幕
- 27. iphone應用程序進入屏幕
- 28. iPhone應用程序加載屏幕
- 29. 加載屏幕 - iPhone應用程序
- 30. iPhone應用內屏幕保護程序
要使用iOS中新的屏幕尺寸;我相信你需要更新你的iOS SDK。您可以從他們的開發人員門戶網站獲取Apple的SDK。還有一個地方可以在Flash Builder中指定iOS SDK。在Flash Builder 4.6中,我相信你需要在MAC上才能更改iOS SDK。 – JeffryHouser