2014-11-16 25 views

Trả lời

30

Bạn có thể sử dụng tệp mobile-config.js phải được đặt ở gốc của dự án. (có sẵn từ 0.9.4) Để có một ví dụ về tệp này, cách đơn giản nhất là xem ví dụ "localmarket" đã làm như thế nào. Chỉ cần gõ:

meteor create --example localmarket 

Sau đó xem các file:

more localmarket/mobile-config.js 

Về cơ bản, các tập tin cần mô tả App.icons và App.launchScreens. Dưới đây là những gì nó phải chứa:

App.icons({ 
    // iOS 
    'iphone': 'resources/icons/icon-60x60.png', 
    'iphone_2x': 'resources/icons/[email protected]', 
    'iphone_3x': 'resources/icons/[email protected]', 
    'ipad': 'resources/icons/icon-76x76.png', 
    'ipad_2x': 'resources/icons/[email protected]', 

    // Android 
    'android_ldpi': 'resources/icons/icon-36x36.png', 
    'android_mdpi': 'resources/icons/icon-48x48.png', 
    'android_hdpi': 'resources/icons/icon-72x72.png', 
    'android_xhdpi': 'resources/icons/icon-96x96.png' 
}); 

App.launchScreens({ 
    // iOS 
    'iphone': 'resources/splash/splash-320x480.png', 
    'iphone_2x': 'resources/splash/[email protected]', 
    'iphone5': 'resources/splash/[email protected]', 
    'iphone6': 'resources/splash/[email protected]', 
    'iphone6p_portrait': 'resources/splash/[email protected]', 
    'iphone6p_landscape': 'resources/splash/[email protected]', 

    'ipad_portrait': 'resources/splash/splash-768x1024.png', 
    'ipad_portrait_2x': 'resources/splash/[email protected]', 
    'ipad_landscape': 'resources/splash/splash-1024x768.png', 
    'ipad_landscape_2x': 'resources/splash/[email protected]', 

    // Android 
    'android_ldpi_portrait': 'resources/splash/splash-200x320.png', 
    'android_ldpi_landscape': 'resources/splash/splash-320x200.png', 
    'android_mdpi_portrait': 'resources/splash/splash-320x480.png', 
    'android_mdpi_landscape': 'resources/splash/splash-480x320.png', 
    'android_hdpi_portrait': 'resources/splash/splash-480x800.png', 
    'android_hdpi_landscape': 'resources/splash/splash-800x480.png', 
    'android_xhdpi_portrait': 'resources/splash/splash-720x1280.png', 
    'android_xhdpi_landscape': 'resources/splash/splash-1280x720.png' 
}); 

Hơn nữa như bạn đang cung cấp đường dẫn cho file, các tập tin cần được đưa vào một resources/iconsresources/splash thư mục mà bạn sẽ đặt trong thư mục gốc của dự án của bạn.

Documentation for mobile-config.js

+0

tôi không thể chỉnh sửa vì nó 'ít hơn 6 ký tự. nhưng ví dụ bây giờ thực sự được gọi là "localmarket", do đó, meteor tạo --example localmarket – kroe

+0

Câu trả lời đúng nhưng kích thước biểu tượng không đầy đủ. Có nhiều kích thước hơn 60x60 và 72x72. Đây có phải là tất cả những gì mà Meteor hỗ trợ không? –

+0

[Đây là danh sách được cập nhật khác] (https://gist.github.com/jperl/f8c395b9f0f1056ad890) với các tham chiếu trên các trang chính thức. Về cơ bản iphone_3x (iPhone6 ​​plus) đã được thêm vào cho các biểu tượng, iPad đã thay đổi kích thước thành [76px chính thức] (https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html) (thay vì 72px) và 3 Màn hình khởi chạy mới cho iPhone6. –

Các vấn đề liên quan