小编Sah*_*unu的帖子

swift UIAlertController与pickerView按钮操作熬夜

我是新手,我正在尝试UIAlertContoller用,PickerView 但我有问题,巴顿斯,这里有一张照片

在此输入图像描述

当我试图改变约束时按钮保持不动我在这里读了很多答案,但我没有找到任何solotuin

这是我的代码:

func distance(){
    let editRadiusAlert = UIAlertController(title: "Choose distance", message: "", preferredStyle: UIAlertControllerStyle.alert)
    let pickeViewFrame: CGRect = CGRect(x: 0, y: 0, width: 250, height: 300)
    let pickerViewRadius: UIPickerView = UIPickerView(frame: pickeViewFrame)
    pickerViewRadius.delegate = self
    pickerViewRadius.dataSource = self
    editRadiusAlert.view.addSubview(pickerViewRadius)
    editRadiusAlert.addAction(UIAlertAction(title: "Done", style: UIAlertActionStyle.default,handler:nil))
    editRadiusAlert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.cancel, handler: nil))
    editRadiusAlert.view.addConstraint(NSLayoutConstraint(item: editRadiusAlert.view, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: self.view.frame.height * 0.5))
    self.present(editRadiusAlert, animated: true, completion: nil)
} 
Run Code Online (Sandbox Code Playgroud)

xcode uipickerview swift uialertcontroller swift3

13
推荐指数
1
解决办法
9167
查看次数

AWS 将文件上传到 S3 REST API - 缺少此请求所需的标头:x-amz-content-sha256

不幸的是,我无法使用AWS SDK,我必须使用REST API AWS服务(我正在使用Flutter WEB)。所以我开始对 aws 文档进行研究,这就是我所做的:

  1. 创建存储桶。

  2. 将所有权限设为公开(仅用于测试)

  3. 开放接入点

然后,在邮递员处,我使用“Auth”aws 签名并添加了当前密钥,会话令牌除外(我的存储桶已打开,我知道我不需要它,如果我弄错了,请纠正我)。当我发送请求时,我收到错误:

Missing required header for this request: x-amz-content-sha256
Run Code Online (Sandbox Code Playgroud)

这是附件图片:

AWS签名 AWS签名

身体要求 身体要求

错误信息在此输入图像描述

amazon-s3 amazon-web-services postman aws-rest-api

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