小编Min*_*ias的帖子

如何在Angular 2 app中配置不同的开发环境

我有一个常量文件

export class constants {
    public static get API_ENDPOINT(): string { return 'https://dvelopment-server/'; }
}
Run Code Online (Sandbox Code Playgroud)

我将它导入我的服务

private _registrationUrl = constants.API_ENDPOINT+'api/v1/register';
Run Code Online (Sandbox Code Playgroud)

如何通过服务器更改来更改endpont.我有开发服务器登台服务器和本地服务器.我希望应用程序检测环境变化.

在我的角度1应用程序中,我使用了envserviceprovider.我可以在角度2应用程序中使用相同的吗?

angular2-services angular

48
推荐指数
3
解决办法
5万
查看次数

游戏中心仅在i OS 6中登录

加载游戏中心时,其默认方向为纵向.为了将其锁定在横向模式中,添加了一个类别.

@implementation GKMatchmakerViewController (LandscapeOnly)

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return ( interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

- (BOOL)shouldAutorotate {
    return NO;
}
@end
Run Code Online (Sandbox Code Playgroud)

它在iOS 6下面工作正常.但在iOS6中显示错误.

由于未捕获的异常'UIApplicationInvalidInterfaceOrientation'而终止应用程序,原因:'支持的方向与应用程序没有共同的方向,并且shouldAutorotate返回YES'

请解释一下解决方案.

iphone uiinterfaceorientation game-center ios6

20
推荐指数
1
解决办法
6648
查看次数

FBSDKShareLinkContent未设置contentDescription和contentTitle

我正试图在Facebook上分享链接FBSDKShareLinkContent.

我已经设置了URL,描述和标题.SDK会根据从中删除的信息自动填充标题和说明contentURL.

但我想设置我在代码中给出的自定义标题和描述.反正有没有避免这种行为?

  FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
[content setContentTitle:@"Testing title"];
[content setContentDescription:@"Testing description."];
content.contentURL = [NSURL URLWithString:[NSString stringWithFormat:@"https://www.google.co.in/"]];
[FBSDKShareDialog showFromViewController:self
withContent:content
delegate:nil];
Run Code Online (Sandbox Code Playgroud)

iphone sdk share facebook ios

19
推荐指数
2
解决办法
1万
查看次数

使用GPUImagePoissonBlendFilter进行混合

我试图使用GPUImage框架的GPUImagePoissonBlendFilter来混合我的面部混合应用程序中的两个面.这是我的代码.

- (void)applyPoissonBlendToImage:(UIImage *) rearFace withImage:(UIImage *) frontFace 
{  
       GPUImagePicture* picture1 = [[GPUImagePicture alloc] initWithImage:rearFace];
       GPUImagePicture* picture2 = [[GPUImagePicture alloc] initWithImage:frontFace];

       GPUImagePoissonBlendFilter * poissonFilter = [[GPUImagePoissonBlendFilter alloc] init];
       poissonFilter.mix = .7;
       poissonFilter.numIterations = 200;

       [picture1 addTarget:poissonFilter];
       [picture1 processImage];

       [picture2 addTarget:poissonFilter];
       [picture2 processImage];

      finalResultImage = [poissonFilter imageFromCurrentlyProcessedOutputWithOrientation:rearFace.imageOrientation];
   }
Run Code Online (Sandbox Code Playgroud)

即如你所见,我给出了两个图像(rearFace和frontFace)作为此方法的输入.图像正面是一种形状(通过连接相对的眼睛和嘴部位置形成的多边形形状),并且具有与后面图像相同的尺寸i.(为了匹配尺寸,我填充了多边形外部的空间绘图时用透明的颜色).

然而,混合不会像我预期的那样发生.即正面的锋利边缘没有适当地混入后面.在这里,我的假设是PoissonBlendFilter开始从其左上角而不是面部的左上边界混合第二个图像.

问题:我觉得输入图像没有正确送入滤镜.我是否需要对输入图像应用某种掩模?任何人都可以指导我吗?

opengl-es objective-c face-detection ios gpuimage

8
推荐指数
1
解决办法
798
查看次数

Store Kit框架是否适用于i OS 6 Simulator?

我在我的应用程序中实现了In App Purchase.它在iPhone 5.1上运行良好.

我知道Store Kit不适用于iPhone模拟器5.1.但在i OS 6模拟器上,我可以连接到App商店,我收到提醒,确认在应用程序购买.但是在iOS 6 Simulator上交易失败并出现错误.

任何人请解释原因.

iphone in-app-purchase ios-simulator ios6 xcode4.5

6
推荐指数
1
解决办法
2489
查看次数