我有很多以编程方式创建的按钮,可以随时更改.我的轻拍手势:
let apriVideoGesture = UITapGestureRecognizer(target: self, action: #selector(PrincipaleController.apriVideo(_:)))
cont.addGestureRecognizer(apriVideoGesture)
func apriVideo(sender : UITapGestureRecognizer){
}
Run Code Online (Sandbox Code Playgroud)
我怎样才能传递参数?像这样的事情:
let apriVideoGesture = UITapGestureRecognizer(target: self, action: #selector(PrincipaleController.apriVideo(stringa : "ciao")))
cont.addGestureRecognizer(apriVideoGesture)
func apriVideo(sender : UITapGestureRecognizer, stringa : String){
}
Run Code Online (Sandbox Code Playgroud)
抱歉英语不好,我是意大利人
我正在WebView使用以下代码从我的服务器加载pdf :
webView = UIWebView(frame: CGRectMake(0, y, screenSize.width, screenSize.height-y))
let url : NSURL! = NSURL(string: urlFile)
webView?.loadRequest(NSURLRequest(URL: url))
webView?.opaque = false;
webView?.backgroundColor = UIColor.clearColor()
webView?.scalesPageToFit = true;
self.view.addSubview(webView!)
Run Code Online (Sandbox Code Playgroud)
此代码有效,但我如何才能收到"onPageLoad"事件?抱歉英语不好,我是意大利人(:
我有这个代码:
let punto = sender.locationInView(self.barraVideo).x
let larghezzaImg : Double = Double((self.barraVideoInvisTocco?.frame.width)!)
let percTocco : Double = (100 / larghezzaImg) * Double(punto)
let lunghezzaVideo : Double = Double(CGFloat((avPlayer?.currentItem?.asset.duration.value)!) / CGFloat(1000.0));
let frameRate : Int32 = (avPlayer?.currentItem?.currentTime().timescale)!
let secondo : Float64 = Float64((lunghezzaVideo/100)*percTocco)
print("Val : \(secondo)");
avPlayer?.currentItem?.seekToTime(CMTimeMakeWithSeconds(secondo, frameRate))
avPlayer?.play()
videoInPlay = true;
playPauseBtn!.image = UIImage(named: "iconaPausa.png")!;
Run Code Online (Sandbox Code Playgroud)
那个骑自行车的人在seekBar上点击并寻找视频.该代码适用于日志视频,但对于短视频工作非常糟糕.当我点击短视频时,AVPlayer只在视频的开头或接近结尾处寻找,而不是在中间
打印:
Val : 3.36008475976495
Val : 7.14189817632069
Val : 13.3303201306846
Val : 3.70388597945183
Val : 3.93308679257642
Val : 3.24548435320265
Val : 3.70388597945183
Val : 18.8311396456748 …Run Code Online (Sandbox Code Playgroud) 我有一个UIWebView我正在渲染PDF的地方.如果pdf不在页面的开头,我需要一种隐藏GUI的方法,如果WebView点击顶部则需要再次显示.我怎么检查这个?
我创建了一个移动 Xamarin PCL 项目。
我正在尝试检测手机(iOS 或 Android)是否为意大利语。我已经尝试过此代码,但我总是收到“en”的返回值,即使手机设置为意大利语也是如此。(在 iOS 上测试)
CultureInfo.CurrentCulture.TwoLetterISOLanguageName.ToString()
Run Code Online (Sandbox Code Playgroud)