我正在努力将广告提供商集成到我的应用中.我希望在广告显示但广告不完整时,在广告前面放置一条淡化消息.
我创建了一个函数,它在我当前的视图中添加了一个子视图,并试图将它带到前面
[self.view bringSubviewToFront:mySubview]
Run Code Online (Sandbox Code Playgroud)
该功能会在加载广告的通知时触发(通知来自广告提供商的SDK).但是,我的子视图不会在广告前面结束.我认为这是广告提供商故意制作的,但我希望无论如何都这样做.我目前正在与提供商讨论是否允许这样做.但就目前而言,我只是想看看它是否可能.
反正我是否可以强迫我的子视图成为最顶级的视图,这样它就不会受到任何阻碍?
我在Winforms应用程序中收到了大量这些消息,即使我从未明确地创建任何线程.为什么会这样?我四处寻找解释,但很难说这样的询问.
我正在使用Visual Studios 2013,这是我关注的调试输出:
The thread 0x23a4 has exited with code 259 (0x103).
The thread 0x2884 has exited with code 259 (0x103).
The thread 0x27ec has exited with code 259 (0x103).
The thread 0x1978 has exited with code 259 (0x103).
The thread 0x1534 has exited with code 259 (0x103).
The thread 0x1ad8 has exited with code 259 (0x103).
The thread 0x2938 has exited with code 259 (0x103).
The thread 0x22c8 has exited with code 259 (0x103).
Run Code Online (Sandbox Code Playgroud) 我在屏幕上有一堆按钮,这些按钮直观地定位,但不是由VoiceOver按直观顺序读取的.这是因为某些按钮(如向上和向下)位于彼此的上方和下方.然而,画外音似乎开始从左到右,从上到下阅读.
这导致画外音在"向上"之后读取"向上"右侧的按钮,而不是在之后立即读取"向下".
如何强制画外音读取我想要阅读的按钮?我应该提一下,我正在使用画外音上的滑动到循环元素功能.
我的所有按钮都是UIView和UIButton的子类.这是我使用的按钮启动器的示例.忽略像素数 - 我知道这是糟糕的形式,但我现在处于紧张状态:
UIButton* createSpecialButton(CGRect frame,
NSString* imageName,
NSString* activeImageName,
id target,
SEL obClickHandler)
{
UIButton* b = [UIButton buttonWithType:UIButtonTypeCustom];
[b setImage:[GlobalHelper nonCachedImage:imageName ofType:@"png"]
forState:UIControlStateNormal];
[b setImage:[GlobalHelper nonCachedImage:activeImageName ofType:@"png"]
forState:UIControlStateHighlighted];
[b addTarget:target action:obClickHandler forControlEvents:UIControlEventTouchUpInside];
b.frame= frame;
return b;
}
- (UIButton *) createSendButton {
CGFloat yMarker = 295;
UIButton* b = createSpecialButton(CGRectMake(160, yMarker, 70, 45),
@"Share_Btn",
@"Share_Selected_Btn",
self,
@selector(sendAction));
b.accessibilityHint = @"Send it!";
b.accessibilityLabel = @"Stuff for voiceover to be added";
[self.view addSubview:b];
return b;
}
Run Code Online (Sandbox Code Playgroud) 我想支持iOS 6轮换.麻烦的是,我一直在查看大量的文档和堆栈溢出问题,但没有找到任何甚至是稍微深入的解决方案.我只是看到我应该将这两个方法添加到我的视图控制器类中 - 但是,如果我没有弄错,它们的操作方式与iOS 6之前的方法不同:
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll; // use what is appropriate for you.
}
Run Code Online (Sandbox Code Playgroud)
我的应用程序目前使用以下代码在iOS6之前轮换.请注意,我使用界面方向参数来确定是否要按下我的视图控制器.如何在iOS 6轮换代理中实现此功能?
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
UIInterfaceOrientation toOrientation = self.interfaceOrientation;
if ( self.tabBarController.view.subviews.count >= 2 )
{
UIView *tabBar = [self.tabBarController.view.subviews objectAtIndex:1];
if(toOrientation != UIInterfaceOrientationLandscapeLeft && toOrientation != UIInterfaceOrientationLandscapeRight)
{
CUSTOM_DEBUG_LOG("\n\nRotated back to Portrait");
tabBar.hidden = FALSE;
}
}
}
- (void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration
{
if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
CUSTOM_DEBUG_LOG("\nView going landscape");
ScrollViewController …Run Code Online (Sandbox Code Playgroud) 对于我的应用程序的加载屏幕和启动画面,我用了两种不同的方法来适当地显示我的iPhone 3,iPhone 4和iPhone 5图像.
对于加载屏幕,只需在图像中添加-568h @ 2x即可支持iPhone5.
对于启动画面,我使用了一系列(if height ==)个案来检查UIScreen界限的高度,并将相应的图像提供给图像视图.在这里我很明显,-568h并不是普遍认为的iPhone 5图像.它仅适用于加载屏幕.
现在,在我的AppDelegate中,我正在设置背景图像.我的所有子视图都具有透明背景,因此它们应该显示在背景图像中.但是,我在这里设置背景图片最困难.
简单地传入"Background.png"将-568h @ 2x添加到文件名的末尾不起作用.它将进行非视网膜和3.5英寸视网膜显示,但不会用于4英寸显示屏.
即:
self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Background.png"]];
Run Code Online (Sandbox Code Playgroud)
如果我使用上面的代码片段,则使用iPhone4图片而不是iPhone5图片,这不是我想要的.
我开始尝试做与使用闪屏一样的事情.我有一堆if case:
CGFloat height = [UIScreen mainScreen].currentMode.size.height;
if ( height == 1136 )
{
//Choose image here
}
else if (height == 960)
{
//Choose image here
}
else if (height == 480)
{
//Choose image here
}
self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:chosenImage]];
Run Code Online (Sandbox Code Playgroud)
但是colorWithPatternImage函数认为selectedImage是1点= 1像素.所以我最终得到的非视网膜图片试图装入iPhone 5屏幕.它看起来有什么特别之处?看起来只有我想要的图像的左上象限显示在整个iPhone 5屏幕上.看起来没有应用视网膜缩放.
我需要让iPhone识别我有一个视网膜友好的iPhone 5图片作为背景.我该怎么做呢?