在我看来,我需要实施一些布局法,根据方向确定适当的布局。 否则,布局就是为了景观取向,因此,如果图象始于 por形模式,我需要采取额外行动,妥善整理意见,以显示在孔隙。
在我的<条码>应用:didFinishLaunching WithOptions:方法中,我用<条码>对方向进行核对。 这里的问题是,即使人们从地貌开始,它总是会回到十字路口。 是否有办法解决这一问题?
在我看来,我需要实施一些布局法,根据方向确定适当的布局。 否则,布局就是为了景观取向,因此,如果图象始于 por形模式,我需要采取额外行动,妥善整理意见,以显示在孔隙。
在我的<条码>应用:didFinishLaunching WithOptions:方法中,我用<条码>对方向进行核对。 这里的问题是,即使人们从地貌开始,它总是会回到十字路口。 是否有办法解决这一问题?
预计会采取这种行动。 Quoth 。
<>说明: 在发射时,申请总是应建立其交接处,以防 por。 在<代码>申请:didFinishLaunching WithOptions:方法回报之后,申请采用上文所述的观察控制器轮换机制,在显示窗户之前将意见转换到适当的方向。
换言之,就装置而言,在申请启动时,其取向为is>/em>。 在<代码>后某个时候适用:didFinishLaunching WithOptions: 它将探测出不同的方向,并打电话到你的<条码>:条码>方法,然后是,你应当按正常处理。
这是检查发射方向的最佳途径。 首先,在您的推荐人中创立一种新办法,检查方向:
-(void)checkLaunchOrientation:(id)sender{
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
BOOL isLandscape = UIDeviceOrientationIsLandscape(self.viewController.interfaceOrientation);
if (UIInterfaceOrientationIsLandscape(orientation) || isLandscape) {
//do stuff here
}
}
在<-application:didFinishLaunching WithOptions:
1 P-4, 1 P-3, 1 P-2
[self performSelectorOnMainThread:@selector(checkLaunchOrientation:) withObject:nil waitUntilDone:NO];
http://www.un.org。 UIViewController 这一点由SOS确定,在某些情况下,比<代码>更为可靠。
详细描述如下:。
如上所述,有一套测试导向的宏观。 然而,这一博客职位提到了UIDeviceOrientationIsPortrait。 我与下文一样,只字不提。
if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation))
{
NSLog(@"Portrait");
}
else
{
NSLog(@"Landscape");
}
我提出的一个意见是,你可以把这部守则放在一张桌上,推向位于不同观点控制器中的导航主计长。 因此,换言之,你可以要求总的看法控制者提一下。 您必须替换“自称方向”,代之以分裂观点控制器。
而是利用地位限制取向来检测。
1. 概念外向导向=[共同应用方法]。
接着,如果你从上述来源获得“定位”。
因此,问题是在启动时检查方向。 可悲的是,答案是“你可以 t”。
但<>>>>AFTERstartup, 您可检查方向的正常方向(如其他人所述)。
如果其他人来到这里寻求答案,那么就只是停止了眼光,因为,在开始的时候,方向变量并未确定(所有观点框架/约束都报告说,即便是 t的,也存在漏洞)。
你希望确保你在“信息清单”中确定适当的钥匙,使你能够了解:
UISupportedInterfaceOrientations
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
你们不需要另一个答案,但我认为我应该补充一点,你们几乎永远都不想使用<条码>[`现有数字”取向]<>。 这种方法回收了该装置的方向,其方向与接口的方向必然相同。
不能说你可以 out出发射方向,确实在后方造成痛苦。
在这方面,你需要做些什么。
your first UIViewController needs to have some special logic to nab the information you d like.
you might even want to create a UIStartupController just for these purposes if it s that important to your flow.
in the case of my project, we already had such a startup controller present.
你们所需要的是以下法典:
-(id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.launchOrientation = UIDeviceOrientationUnknown;
}
return self;
}
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration
{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
if (self.launchOrientation == UIDeviceOrientationUnknown && duration > 0)
self.launchOrientation = UIInterfaceOrientationPortrait;
else
self.launchOrientation = toInterfaceOrientation;
}
basically, if we re not launching in UIInterfaceOrientationPortrait, the first rotation callback sequence will actually reveal the launch orientation.
if launched in UIInterfaceOrientationPortrait, then we need to check that the first rotation s duration is non zero, and then we know that it was launched from portrait.
For a basic app with nonconsumable in-app purchases, has anyone figured out best practices for using SKPaymentQueue s restoreCompletedTransactions? Observations I know it s recommended to always ...
I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...
I have a UITextField that is a subview of a UITableViewCell. When my view loads, I want the text field to become first responder. I have a pointer to the text field in the table cell, so to do this I ...
I ve been working on adding in-app purchases and was able to create and test in-app purchases using Store Kit (yay!). During testing, I exercised my app in a way which caused the app to crash mid ...
In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...
Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...
I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...
Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...