产品设计要求是这样的:

对应的初步代码是这样的:

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib. UIImageView *imageView = [[UIImageView alloc] init];
imageView.frame = CGRectMake(, , [UIScreen mainScreen].bounds.size.width, );
imageView.image = [UIImage imageNamed:@"123.jpeg"];
[self.view addSubview:imageView]; } - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
[self showStoreProductInApp:@""];
} - (void)showStoreProductInApp:(NSString *)appID{ Class isAllow = NSClassFromString(@"SKStoreProductViewController"); if (isAllow != nil) { SKStoreProductViewController *sKStoreProductViewController = [[SKStoreProductViewController alloc] init];
[sKStoreProductViewController setDelegate:self];
[sKStoreProductViewController.view setFrame:CGRectMake(, , [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - )]; [self.view addSubview:sKStoreProductViewController.view]; __weak typeof(self) weakSelf = self;
[sKStoreProductViewController loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier: appID}
completionBlock:^(BOOL result, NSError *error) {
__strong typeof(weakSelf) strongSelf = weakSelf; if (result) {
/*
// 也可以再这里实现该界面的预加载(会先出来一个连返回按钮都没有的空白页)
[strongSelf.view addSubview:sKStoreProductViewController.view];
*/ }else{
NSLog(@"error:%@",error);
}
}];
}else{
//低于iOS6的系统版本没有这个类,不支持这个功能
NSString *string = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/xxxxxxx/app/id%@?mt=8",appID];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]];
}
} - (void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController { [viewController.view removeFromSuperview];
}

对应的初步效果是这样的:

(<--- iOS11以后)(<--- iOS11之前)

后面再严格按照UE的效果进行微调设计就可以了。

应用内打开AppStore上某个应用的下载界面--SKStoreReviewController的使用的更多相关文章

  1. 已经上架的app(可供销售)在AppStore上搜不到的解决办法

    这两天很是头大, 因为3天前手动发布的app到现在都还没在AppStore上看到,打了无数电话给苹果和发邮件给review团队. 下面说说怎么解决我们在iTunes后台看到是绿灯(可供销售)但是就是在 ...

  2. 如何获取AppStore上应用的ipa安装包

    1.首先你得去下载一个Apple Configurator 2,我们通过这个工具来获取ipa包,从AppStore上下载安装你需要获取的App 2.连接手机,打开Apple Configurator ...

  3. 在app中打开appStore中其他app

    var str = "https://itunes.apple.com/cn/app/zhang-jiange-hao-tou-zi-ke/id402382976?mt=8"//这 ...

  4. 关于wcf异常异常信息:由于内部错误,服务器无法处理该请求。有关该错误的详细信息,请打开服务器上的 IncludeExceptionDetailInFaults (从 ServiceBehaviorAttribut

    异常信息:由于内部错误,服务器无法处理该请求.有关该错误的详细信息,请打开服务器上的 IncludeExceptionDetailInFaults (从 ServiceBehaviorAttribut ...

  5. 错误提示:通过 Web 服务器的身份验证的用户无权打开文件系统上的文件

    //win7中iis配置好了可是网页打不开,为什么.? //错误提示:通过 Web 服务器的身份验证的用户无权打开文件系统上的文件 //解决办法1.右键单击你的网站根目录文件夹,如wwwroot文件夹 ...

  6. Unity iOS打开AppStore评星页面,浅谈Application.OpenURL()方法。

    http://fairwoodgame.com/blog/?p=38 Unity iOS打开AppStore评星页面,浅谈Application.OpenURL()方法. Posted in  Uni ...

  7. 使用input:file控件在微信内置浏览器上传文件返回未显示选择的文件

    使用input:file控件在微信内置浏览器上传文件返回未显示选择的文件 原来的写法: <input type="file" accept="image/x-png ...

  8. JAVA判断是否是微信内置浏览器,是否是在微信内打开

    /** * 通过请求头判断是否是微信内置浏览器,是否是在微信内打开 * @param request * @return */ @RequestMapping(value = "/hello ...

  9. 了解一下 Linux 上用于的 SSH 图形界面工具

    如果你碰巧喜欢好的图形界面工具,你肯定很乐于了解一些 Linux 上优秀的 SSH 图形界面工具.让我们来看看这三个工具,看看它们中的一个(或多个)是否完全符合你的需求. 在你担任 Linux 管理员 ...

随机推荐

  1. ASP.NET Core搭建多层网站架构【3-xUnit单元测试之简单方法测试】

    2020/01/28, ASP.NET Core 3.1, VS2019, xUnit 2.4.0 摘要:基于ASP.NET Core 3.1 WebApi搭建后端多层网站架构[3-xUnit单元测试 ...

  2. ETCD成员维护

    # For each machine TOKEN=my-etcd-token-1 CLUSTER_STATE=new NAME_1=etcd-node-1 NAME_2=etcd-node-2 NAM ...

  3. 吴裕雄 python 神经网络——TensorFlow 变量管理

    import tensorflow as tf with tf.variable_scope("foo"): v = tf.get_variable("v", ...

  4. 为typecho添加分类描述

    typecho 默认主题不显示分类描述,可以调整为显示 按找官方文档(点击查看),获取分类描述的代码为: <?php echo $this->getDescription(); ?> ...

  5. opencv人脸识别提取手机相册内人物充当数据集,身份识别学习(草稿)

    未写完 采用C++,opencv+opencv contrib 4.1.0 对手机相册内人物opencv人脸识别,身份识别学习 最近事情多,介绍就先不介绍了 photocut.c #include & ...

  6. SVN 锁定无法提交命令执行失败

    有个项目使用svn 高版本客户端作业,转换到低版本的环境下,出现锁定,命令执行失败. 使用cleanup 没有效果, 网上建议的svn无法Cleanup解决方法: Step1:到 sqlite官网 ( ...

  7. 多Python版本共存

    Python 3.4 和 3.7 共存 我的电脑上同时安装了 Python 3.4 和 Python 3.7 两个 Python 版本.现在打开终端窗口进入指定的版本. py -3.4 py -3.7 ...

  8. javaweb使用button的onclick属性访问servlet

    1.定义一个servlet: 如我定义了一个名称为Choose_class.java的servlet 2.定义一个button <input type="button"  v ...

  9. linux目录与路径

    1.相对路径和绝对路径 绝对路径:一定是从根目录开始,如:/usr/share/doc 相对路径:如果想从/usr/share/doc/到/usr/share/man下,可以写成 cd ../man, ...

  10. PAT T1005 Programming Pattern

    建立后缀数组,遍历height数组找到连续大于len的最长子序列~ #include<bits/stdc++.h> using namespace std; ; char s[maxn]; ...