小编sco*_*NHO的帖子

以mp4格式录制,保存和/或转换视频?

我有以下问题 - 我正在尝试创建一个记录视频的应用程序,然后将其保存到相机胶卷,之后我将该视频上传到网络.问题是唯一支持的格式是"mp4",但我的视频是"mov".

所以我的问题是如何以"mp4"格式从相机保存视频,或将其保存在"mov"中,然后将其转换为"mp4".

这是我的代码:

  • 这是我打开相机的方式:

    picker = [[UIImagePickerController alloc] init];
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;
    picker.delegate = self;
    picker.showsCameraControls = YES;
    picker.allowsEditing = YES;
    picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil];
    [self presentViewController:picker animated:YES completion:nil];
    
    Run Code Online (Sandbox Code Playgroud)
  • 这是我保存视频的方式:

    NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
    
    if (CFStringCompare ((__bridge_retained CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo)
    {
        NSString *moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
        videoURL = info[UIImagePickerControllerMediaURL];
    
        if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(moviePath))
        {
            UISaveVideoAtPathToSavedPhotosAlbum(moviePath, self, nil, nil);
        }
    }
    [nextScreenButton setTitle:@"????????" forState:UIControlStateNormal];
    [self dismissViewControllerAnimated:YES completion:nil];
    
    Run Code Online (Sandbox Code Playgroud)

提前致谢!

iphone video xcode mp4 ios

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

UITextField字体样式不变

我有以下问题 - 我想将UITextField字体更改为自定义字体.我正在使用这行代码:

textField.font = [UIFont fontWithName:@"fontname.ttf" size:20];
Run Code Online (Sandbox Code Playgroud)

我想用这个字体: Neurm.ttf 你可以告诉我有什么问题或者只是尝试一下然后告诉我它是否正常工作?

iphone xcode input objective-c textfield

7
推荐指数
2
解决办法
9936
查看次数

用于 Flutter 中 PayPal 支付的 Braintree 集成

我必须在 Flutter 中集成 PayPal 付款,唯一似乎具有这种功能的插件是flutter_braintree。但是那里的文档并没有那么详细,所以我有点困惑如何使用这个插件进行真正的支付。我的任务是实现这种流程:单击应用程序中的 PayPal 按钮,然后继续使用 PayPal 向预定义的 IBAN 付款。我试图检查 PayPal 和 Braintree 文档,但由于没有提到 Flutter,我有点困惑。请帮助我什么是正确的方向,以满足我的要求。我有以下问题:

  1. 如何使用此插件并进行实际付款?我需要什么 - 据我所知,一个客户端令牌,但我将在 Flutter 中生成它?
  2. 我应该把我想要转账的 IBAN 放在哪里?
  3. 我应该为 PayPal 使用某种 webviews,还是这个插件就足够了?

提前谢谢你,我真的被这个话题困住了,找不到解决办法。

plugins paypal token braintree flutter

7
推荐指数
1
解决办法
2034
查看次数

UITextView 中两个具有不同颜色的超链接?

我正在尝试创建一个 UITextView,其中有两个链接作为文本,但颜色不同。我不确定这是否可能。

我已将 UITextView 设置为检测链接,不可编辑,而只能选择。

到目前为止我所做的如下:

NSMutableAttributedString *termsAndConditionsTitle = [[NSMutableAttributedString alloc] initWithString:@"I have read the " attributes:@{NSLinkAttributeName: @"https://apple.com", NSForegroundColorAttributeName: [UIColor greenColor]}];
NSMutableAttributedString *someString2 = [[NSMutableAttributedString alloc] initWithString:@"terms and conditions" attributes:@{NSLinkAttributeName: @"https://microsoft.com", NSForegroundColorAttributeName: [UIColor redColor]}];
[termsAndConditionsTitle appendAttributedString:someString2];
[self.termsAndConditionsView setAttributedText:termsAndConditionsTitle];
Run Code Online (Sandbox Code Playgroud)

但最终链接只有 UITextView 的色调颜色。是否可以使两个链接具有不同的颜色?提前致谢!

PS 如果可能的话,我不想使用库/框架。

objective-c hyperlink uitextview nsattributedstring ios

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

在 Flutter 中使用 Google Sign-In 获取用户的生日/性别

我想使用 Firebase Auth 和 Google Sign-In 获取用户的生日和性别。不幸的是,登录发生后,我只得到用户的电子邮件、显示名称、照片网址和电话号码。我看到我可以向 GoogleSignIn 对象添加范围,我这样做 - https://www.googleapis.com/auth/user.birthday.readhttps://www.googleapis.com/auth/userinfo.profile,但是,登录后我仍然看不到任何其他数据。知道如何得到这个结果吗?因为当这些范围被添加到对象时,它会在登录之前询问我是否接受提供这些数据,所以我想应该有一种方法来获取和显示它们。

这是我的登录代码:

  final GoogleSignIn _googleSignIn = GoogleSignIn(scopes: ["email", "https://www.googleapis.com/auth/user.birthday.read", "https://www.googleapis.com/auth/userinfo.profile"]);
  final FirebaseAuth _auth = FirebaseAuth.instance;

  Future<FirebaseUser> _handleSignIn() async {
    final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
    final GoogleSignInAuthentication googleAuth = await googleUser.authentication;

    final AuthCredential credential = GoogleAuthProvider.getCredential(
      accessToken: googleAuth.accessToken,
      idToken: googleAuth.idToken,
    );

    final FirebaseUser user = (await _auth.signInWithCredential(credential)).user;
    return user;
  }
Run Code Online (Sandbox Code Playgroud)

authentication dart firebase-authentication google-signin flutter

5
推荐指数
1
解决办法
2459
查看次数

Pods-Alamofire:静态库不支持Swift

我有一个在Swift 1.2和iOS 8.4上运行的项目.在更新到Swift 2和iOS 9之后,我进行了"pod update"来更新我的pod.现在有一个Pods-Alamofire错误:"静态库不支持Swift." 任何想法如何解决这一问题?

xcode ios cocoapods swift alamofire

3
推荐指数
1
解决办法
2321
查看次数

试图在iPhone iOS 6.1.2上测试我的应用程序,但"没有配置iOS设备......"错误?

我有一个大问题.我有一个带有iOS 6.1.2的iPhone和最新版本的Xcode - 4.6.1.当我尝试在该设备上测试我的应用时,Xcode说

"没有配置的iOS设备可用于兼容的iOS版本.将iOS设备与最新版本的iOS连接以运行您的应用程序或选择iOS模拟器作为目标."

问题在哪里以及如何解决?我尝试进入管理器,右键单击设备并将设备添加到配置文件,但没有结果.提前致谢!

xcode version device provisioning ios

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

在Swift中绘制带有标题的甜甜圈图

任何想法如何绘制带有这样标题的甜甜圈图:

在此处输入图片说明

我尝试了几个库,但没有成功。我无法在每个切片之间创建这些白线。带下划线的标题对我来说也太困难了。任何帮助将不胜感激!先感谢您!

iphone charts draw ios swift

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