iPad Mini 용으로 개발하고 싶지만 시뮬레이터에는 Xcode 4.5가 포함되어 있지 않습니다. 새로운 iPad Mini에서 내 앱이 어떻게 보이는지 알 수있는 방법이 있습니까? Cordova 프레임 워크를 사용하고 있습니다.Cordova/Phonegap으로 iPad mini를 개발하려면 어떻게해야합니까?
0
A
답변
-1
당신의 AppDelegate.m 파일에
이동하고 여기에 코드로 대체 :이 아이 패드 미니에 대한 개발하고자하는 사람들에게 도움이 될 것입니다
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
//
// AppDelegate.m
// YOUR PROJECT NAME HERE
//
// Created by YOUR NAME HERE
// Copyright YOUR NAME HERE 2012. All rights reserved.
//
#import "AppDelegate.h"
#import "MainViewController.h"
#ifdef CORDOVA_FRAMEWORK
#import <Cordova/CDVPlugin.h>
#import <Cordova/CDVURLProtocol.h>
#else
#import "CDVPlugin.h"
#import "CDVURLProtocol.h"
#endif
@implementation AppDelegate
@synthesize window, viewController;
- (id) init
{
/** If you need to do any extra app-specific initialization, you can do it here
* -jm
**/
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
[cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
[CDVURLProtocol registerURLProtocol];
return [super init];
}
#pragma UIApplicationDelegate implementation
/**
* This is main kick off after the app inits, the views and Settings are setup here. (preferred - iOS4 and up)
*/
- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
NSString* invokeString = nil;
if (url && [url isKindOfClass:[NSURL class]]) {
invokeString = [url absoluteString];
NSLog(@"YOUR PROJECT NAME HERE launchOptions = %@", url);
}
CGRect screenBounds = [[UIScreen mainScreen] bounds];
self.window = [[[UIWindow alloc] initWithFrame:screenBounds] autorelease];
self.window.autoresizesSubviews = YES;
CGRect viewBounds = [[UIScreen mainScreen] applicationFrame];
self.viewController = [[[MainViewController alloc] init] autorelease];
self.viewController.useSplashScreen = YES;
self.viewController.wwwFolderName = @"www";
self.viewController.startPage = @"index.html";
self.viewController.invokeString = invokeString;
self.viewController.view.frame = viewBounds;
// check whether the current orientation is supported: if it is, keep it, rather than forcing a rotation
BOOL forceStartupRotation = YES;
UIDeviceOrientation curDevOrientation = [[UIDevice currentDevice] orientation];
if (UIDeviceOrientationUnknown == curDevOrientation) {
// UIDevice isn't firing orientation notifications yet… go look at the status bar
curDevOrientation = (UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation];
}
if (UIDeviceOrientationIsValidInterfaceOrientation(curDevOrientation)) {
for (NSNumber *orient in self.viewController.supportedOrientations) {
if ([orient intValue] == curDevOrientation) {
forceStartupRotation = NO;
break;
}
}
}
if (forceStartupRotation) {
NSLog(@"supportedOrientations: %@", self.viewController.supportedOrientations);
// The first item in the supportedOrientations array is the start orientation (guaranteed to be at least Portrait)
UIInterfaceOrientation newOrient = [[self.viewController.supportedOrientations objectAtIndex:0] intValue];
NSLog(@"AppDelegate forcing status bar to: %d from: %d", newOrient, curDevOrientation);
[[UIApplication sharedApplication] setStatusBarOrientation:newOrient];
}
[self.window addSubview:self.viewController.view];
[self.window makeKeyAndVisible];
CGFloat scale = 4.71f/5.82f;
CGAffineTransform scaleTransform = CGAffineTransformMakeScale(scale, scale);
self.window.transform = CGAffineTransformConcat(scaleTransform, self.window.transform);
self.window.clipsToBounds = YES;
[self statusBarChanged:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(statusBarChanged:)
name:UIApplicationDidChangeStatusBarOrientationNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
return YES;
}
- (void)statusBarChanged:(NSNotification *)note {
CGFloat scale = 4.71f/5.82f;
CGAffineTransform scaleTransform = CGAffineTransformMakeScale(scale, scale);
UIWindow *statusBarWindow = (UIWindow *)[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"];
statusBarWindow.transform = CGAffineTransformConcat(scaleTransform, statusBarWindow.transform);
}
- (void)keyboardWillShow:(NSNotification *)note {
[self performSelector:(@selector(doMagicToKeyboard)) withObject:nil afterDelay:0];
}
-(void)doMagicToKeyboard {
for (UIWindow *window in [[UIApplication sharedApplication] windows]) {
[self checkForKeyboard:window];
}
}
- (void)checkForKeyboard:(UIView *)view {
static BOOL didIt = NO;
for (UIView *currentView in view.subviews) {
if(([[currentView description] hasPrefix:@"<UIKeyboard"] == YES) && !didIt)
{
didIt = YES;
UIView *thisView = currentView.superview.superview;
thisView.clipsToBounds = YES;
CGFloat scale = 4.71f/5.82f;
CGAffineTransform scaleTransform = CGAffineTransformMakeScale(scale, scale);
thisView.transform = CGAffineTransformConcat(scaleTransform, thisView.transform);
} else {
[self checkForKeyboard:currentView];
}
}
}
// this happens while we are running (in the background, or from within our own app)
// only valid if Ipad Mini-Info.plist specifies a protocol to handle
- (BOOL) application:(UIApplication*)application handleOpenURL:(NSURL*)url
{
if (!url) {
return NO;
}
// calls into javascript global function 'handleOpenURL'
NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url];
[self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
// all plugins will get the notification, and their handlers will be called
[[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
return YES;
}
- (void) dealloc
{
[super dealloc];
}
@end
; 새로운 iPad Mini에서 앱의 모습을 정확히 볼 수있는 기회를 제공합니다. Michael Slaters 블로그에서 읽은 위대한 기사가 없으면 불가능합니다. 그가 코르도바 응용 프로그램을 위해이 작업을 수행하는 과정을 안내 한 게시물이 있습니다. 감사합니다 마이클!
0
는 시뮬레이터가있다 -는 아이 패드 시뮬레이터라고. iPad mini는 iPad와 동일한 해상도를 가지고 있습니다. 유일한 차이점은 픽셀 밀도입니다. 즉, iPad mini는 iPad보다 높은 픽셀 밀도를 가지고 있습니다.
관련 문제
- 1. 인터넷 메신저를 개발하려면 어떻게해야합니까?
- 2. Windows 플랫폼에서 iOS 응용 프로그램을 개발하려면 어떻게해야합니까?
- 3. iOS에서 Pandora와 같은 앱을 개발하려면 어떻게해야합니까?
- 4. CGI.pm으로 웹 2.0 앱을 개발하려면 어떻게해야합니까?
- 5. Qt로 OpenGL ES 응용 프로그램을 개발하려면 어떻게해야합니까?
- 6. 잘 구조화 된 C++ 프로그램을 개발하려면 어떻게해야합니까?
- 7. 그놈 툴바 그래픽 위젯을 개발하려면 어떻게해야합니까?
- 8. 프로토콜을 알고 응용 프로그램을 개발하려면 어떻게해야합니까?
- 9. iPad 용으로 개발하려면 Mac OS X 10.6이 필요합니까?
- 10. Ipad : 모든 iPad 모델에서 성능을 테스트하려면 어떻게해야합니까?
- 11. 트리 구조를 개발하려면
- 12. ipad/iphone에서 인쇄하려면 어떻게해야합니까?
- 13. play2-mini를 개발 모드에서 실행하는 방법
- 14. Akka microkernel에서 Play-mini를 사용하는 방법은 무엇입니까?
- 15. 세로 및 가로 표시 형식을 모두 개발하려면 어떻게해야합니까?
- 16. 크롬 및/또는 Chromium 용 파일 핸들러를 개발하려면 어떻게해야합니까?
- 17. 자신의 ePub reader android 응용 프로그램을 개발하려면 어떻게해야합니까?
- 18. 트위터에 SSO를 사용하여 lib를 개발하려면
- 19. iPad 앱에서 애니메이션을 만들려면 어떻게해야합니까?
- 20. Akka/Play-mini를 사용하여 REST 호출에서 문자열 반환
- 21. SharePoint 응용 프로그램을 개발하려면 무엇이 필요합니까?
- 22. XBOX 360 용 게임을 개발하려면 무엇이 필요합니까?
- 23. java를 사용하는 응용 프로그램과 같이 teamviewer를 개발하려면
- 24. Apple Tv 앱을 개발하려면 Xcode에 무엇이 설치해야합니까?
- 25. iPad HTML5 앱에서 키보드 팝업을 억제하려면 어떻게해야합니까?
- 26. 로컬 IIS 포트에 ipad 액세스를 허용하려면 어떻게해야합니까?
- 27. iPad 앱을 닫을 때마다 다시 시작하도록하려면 어떻게해야합니까?
- 28. 끈적 끈적한 iPad 스플래시 화면을 제거하려면 어떻게해야합니까?
- 29. iPad : CGAffineTransformScale을 사용하여 동적 barchart를 만들려면 어떻게해야합니까?
- 30. iPad 앱에서 여러 개의보기를 사용하려면 어떻게해야합니까?
OP에서 코르도바를 사용하고 있습니다. 즉, HTML5/자바 스크립트 앱을 작성하고 있습니다. – ColinE
그래서 ...? 질문은 iPad Mini를 개발하는 방법을 묻는 것이지 앱이 작성된 언어가 아닙니다. – Mike