小编Nas*_*han的帖子

WKWebView 不允许在应用程序中访问相机

我们正在尝试与多个用户进行电话会议,因此通过使用 Kurento 服务器,我们已经实现了这一点,并且它可以在 safari 浏览器上运行。但是当涉及到WebView/中的实现时WKWebView。它甚至不请求许可。

@IBOutlet weak var webViewContainer: UIView!
var webView: WKWebView!

override open func loadView() {
    super.loadView()

    let webConfiguration = WKWebViewConfiguration()
    webConfiguration.ignoresViewportScaleLimits = true
    webConfiguration.suppressesIncrementalRendering = true
    webConfiguration.allowsInlineMediaPlayback = true
    webConfiguration.allowsAirPlayForMediaPlayback = false
    webConfiguration.allowsPictureInPictureMediaPlayback = true
    webConfiguration.mediaTypesRequiringUserActionForPlayback = .all
    webConfiguration.requiresUserActionForMediaPlayback = true
    webView = WKWebView(frame: webViewContainer.frame, configuration: webConfiguration)
    webView.uiDelegate = self
    webView.navigationDelegate = self
    webView.sizeToFit()
    webView.backgroundColor = .black
    webView.isOpaque = false
    self.webViewContainer.addSubview(webView)

}

func webContentController()-> WKUserContentController {
    let contentController = WKUserContentController()
    let script = …
Run Code Online (Sandbox Code Playgroud)

ios webrtc swift wkwebview kurento

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

如何在 flutter 中制作自定义气泡形状?

我正在尝试创建一个两边都有三角形形状的自定义工具提示。我创建了一个气泡,但如何在不使用任何库的情况下添加三角形?

class SdToolTip extends StatelessWidget {
  final Widget child;
  final String message;

  const SdToolTip({
    required this.message,
    required this.child,
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Tooltip(
        child: child,
        message: message,
        padding: const EdgeInsets.all(8),
        decoration: BoxDecoration(
            color: Colors.blueAccent.withOpacity(0.6),
            borderRadius: BorderRadius.circular(22)),
        textStyle: const TextStyle(
            fontSize: 15, fontStyle: FontStyle.italic, color: Colors.white),
      ),
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

tooltip shapes dart flutter

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

无效的代码签名权利?

我在app store上传应用时发现了这些错误,有人能解决这个问题吗?

Error ITMS-9000: "Invalid code signing entitlements. Your application bundle's signature contains code signing entitlement that are not supported on iOS. specifically, value '*' for key 'com.apple.developer.associated-domamains' in 
'Payload/battleofchampionsHDIOS.app/battleofchampionsHDIOS' is not support."
Run Code Online (Sandbox Code Playgroud)

我已经尝试了以前的方法一样,残疾人是iCloud,` 再生临时型材多次,刷新了Xcode中/ MAC /临时配置文件在Xcode.但仍然一次又一次地出现同样的错误.

xcode runtime-error submit app-store ios

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

当AVPlayer准备播放时,AVPlayer的addObserver永远不会被调用?

我已经将观察者添加到AVPlayer但是当avplayer状态准备就绪时它没有调用该函数.当视频开始播放时,该函数调用两次,但AVPlayer的持续时间参数都返回'nan',而我需要在AVPlayer准备播放时获得持续时间.

    playerController.player = player
    self.addChildViewController(playerController)
    self.view.addSubview(playerController.view)
    playerController.view.frame = self.view.frame
    playerController.showsPlaybackControls = false
    player.addObserver(self, forKeyPath: "status", options: NSKeyValueObservingOptions(), context: nil)
    player.play()

override func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutablePointer<Void>) {
    if player.currentItem?.status == AVPlayerItemStatus.ReadyToPlay {
      print("a")  
    }
}
Run Code Online (Sandbox Code Playgroud)

observers ios avplayer swift ios9.1

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

如何在UIView类中调用presentViewController?

我的项目中有一个自定义选项卡,位于应用程序的每个屏幕上,因此我创建了自定义UIView类和xib文件,并在其中添加了按钮.现在我希望我的按钮在不同的屏幕上具有不同的story boardID.但我无法presentViewControllerUIView课堂上打电话.以前我在extension课堂上自定义功能,以在屏幕之间导航,但UIView类也无法调用该功能.

import UIKit

@IBDesignable class tab: UIView {

var view: UIView!

@IBAction func btn1(sender: UIButton) {
    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let vc = storyboard.instantiateViewControllerWithIdentifier("6")
    self.presentViewController(vc, animated: true, completion: nil)
}
override init(frame: CGRect) {
    super.init(frame: frame)
    xibSetup()
}

required init?(coder aDecoder: NSCoder) { 
    super.init(coder: aDecoder) 
    xibSetup()
}

func xibSetup() {
    view = loadViewFromNib() 
    view.frame = bounds 
    view.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight] 
    addSubview(view)
} …
Run Code Online (Sandbox Code Playgroud)

uiview ios presentviewcontroller swift

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

以相同的方式在GMSAutocomplete中使用textfield而不是searchbar

我正在使用谷歌广告自动完成API,我需要添加UITextField而不是UISearchBar具有相同的功能.这是UISearchBar的工作代码,我可以从https://developers.google.com/places/ios-api/autocomplete获取.我会自己添加textfield和tableview,如果有人帮我从任何搜索关键字获取地址数组.比如从字符串(关键字)到数组(预测的地方).

import UIKit
import GoogleMaps

class ViewController: UIViewController {

var resultsViewController: GMSAutocompleteResultsViewController?
var searchController: UISearchController?
var resultView: UITextView?

override func viewDidLoad() {
    super.viewDidLoad()

    resultsViewController = GMSAutocompleteResultsViewController()
    resultsViewController?.delegate = self

    searchController = UISearchController(searchResultsController: resultsViewController)
    searchController?.searchResultsUpdater = resultsViewController

    let subView = UIView(frame: CGRectMake(0, 65.0, 350.0, 45.0))

    subView.addSubview((searchController?.searchBar)!)
    self.view.addSubview(subView)
    searchController?.searchBar.sizeToFit()
    searchController?.hidesNavigationBarDuringPresentation = false
    self.definesPresentationContext = true
}
}

extension ViewController: GMSAutocompleteResultsViewControllerDelegate {
func resultsController(resultsController: GMSAutocompleteResultsViewController,
    didAutocompleteWithPlace place: GMSPlace) {
        searchController?.active = false
        print("Place name: ", place.name)
        print("Place address: ", place.formattedAddress!)
} …
Run Code Online (Sandbox Code Playgroud)

google-maps autocomplete ios google-places-api swift

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