我最近开始收到以下控制台错误,没有发生任何代码更改.
我最近没有安装任何扩展程序.
Failed to load resource: net::ERR_FAILED chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js
Failed to load resource: net::ERR_FAILED chrome-extension://hfaagokkkhdbgiakmmlclaapfelnkoah/cast_sender.js
Failed to load resource: net::ERR_FAILED chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js
Failed to load resource: net::ERR_FAILED chrome-extension://fmfcbgogabcbclcofgocippekhfcmgfj/cast_sender.js
Failed to load resource: net::ERR_FAILED
Run Code Online (Sandbox Code Playgroud)
我在页面上有几个触发此错误的YouTube播放器嵌入,但它们很简单:
<iframe width="100%" height="100%" src="http://www.youtube.com/embed/OUR_YOUTUBE_ID?showinfo=0&wmode=transparent" frameborder="0" allowfullscreen=""></iframe>
Run Code Online (Sandbox Code Playgroud)
有没有人经历过这个?
更新到Chrome 40.0.2214.111后,当我访问某些与Google相关的网站(例如http://youtube.com并在视频播放前看到广告)时,浏览器会下载名为的文件f.txt.
我没有安装任何adblock插件.
f.txt 包含几行JavaScript ...开头:
if (!window.mraid) {document.write('\x3cdiv class="GoogleActiveViewClass" ' +'id="DfaVisibilityIdentifier_3851468350"\x3e');}document.write('\x3ca target\x3d\x22_blank\x22 href\x3d\x22https://adclick.g.doubleclick.net/pcs/click?xai\x3dAKAOjsvDhmmoi2r124JkMyiBGALWfUlTX-zFA1gEdFeZDgdS3JKiEDPl3iIYGtj9Tv2yTJtASqD6S-yqbuNQH5u6fXm4rThyCZ0plv9SXM-UPKJgH4KSS08c97Eim4i45ewgN9OoG3E_
Run Code Online (Sandbox Code Playgroud)
在Google上查找问题时,其他人也遇到过相同的问题,但我没有找到任何解决方案或理解为什么会发生这种情况.我认为这是content-disposition与页面上加载的一些JS文件相关的错误,并将在未来的补丁中清除.
想知道是否有其他人有经验/见解.
我已经设置了一个带有FlowLayout的UICollectionView,它在垂直或水平方向的单元格之间不留空间.
我有一切正常,但第二列和第三列之间有一个奇怪的1px空间,我不明白为什么!?我已经验证了在iOS模拟器和真实设备上显示的1px差距.有没有人经历过这个?
我的UIViewController是以下的委托/数据源:
class MyViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout
我已经实现了必要的功能来删除任何间距(并通过它们正在运行的打印语句进行验证),以及对彼此相邻排列的单元格的可视化确认:
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets {
return UIEdgeInsetsZero
}
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAtIndex section: Int) -> CGFloat {
return 0
}
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAtIndex section: Int) -> CGFloat {
return 0
}
Run Code Online (Sandbox Code Playgroud)
最后,我打印出要返回的单元格的宽度(每个颜色方块)以验证它是(view.frame.width / 3)或者(320/3),这是106.666667
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
var totalHeight: CGFloat = (self.view.frame.width / …Run Code Online (Sandbox Code Playgroud) 为什么这两行给我不同的结果?
var str = "Hello " // the square is an emoji
count(str) // returns 7
(str as NSString).length // returns 8
Run Code Online (Sandbox Code Playgroud)
原件供参考:

我有一个UITextViews用于显示文本的应用程序(可能是多行),并且在iOS8中正常工作.我通过声明关闭了滚动self.scrollEnabled = false.UITextView在需要的时候会把话语分解成新的行,所有这些似乎都在起作用!
但是,当我在iOS9上运行代码时,UITextView只会显示1行文本(无论有多少行文本).
我意识到当我删除self.scrollEnabled = false线条时,UITextView渲染正确(显示所有线条),但它显然是可以滚动的,这不是意图.
我该怎么做才能UITextView渲染多行并关闭滚动?有没有人见过这个问题或有任何建议?
谢谢!
我试图动画CAShapeLayer的路径,以便我得到一个圆圈"填充"达到特定数量的效果.
问题
它"作品",而不是AS,因为我认为这可能是的,我想介绍一些宽松政策之平滑.但是因为我是单独制作每个%的动画,所以我不确定现在是否可能.所以我正在寻找可以解决这个问题的替代方案!
视觉解释
首先 - 这里是我想要实现的动画的一些"帧"(参见图片 - 圈子填充从0%到25%)
码
我创建绿色笔划(外部):
let ovalPath = UIBezierPath(ovalInRect: CGRectMake(20, 20, 240, 240))
let circleStrokeLayer = CAShapeLayer()
circleStrokeLayer.path = ovalPath.CGPath
circleStrokeLayer.lineWidth = 20
circleStrokeLayer.fillColor = UIColor.clearColor().CGColor
circleStrokeLayer.strokeColor = colorGreen.CGColor
containerView.layer.addSublayer(circleStrokeLayer)
Run Code Online (Sandbox Code Playgroud)
我创建填充形状的初始路径(内部):
let filledPathStart = UIBezierPath(arcCenter: CGPoint(x: 140, y: 140), radius: 120, startAngle: startAngle, endAngle: Math().percentToRadians(0), clockwise: true)
filledPathStart.addLineToPoint(CGPoint(x: 140, y: 140))
filledLayer = CAShapeLayer()
filledLayer.path = filledPathStart.CGPath
filledLayer.fillColor = colorGreen.CGColor
containerView.layer.addSublayer(filledLayer)
Run Code Online (Sandbox Code Playgroud)
然后我使用for循环和CABasicAnimations数组进行动画处理.
var animations: [CABasicAnimation] = [CABasicAnimation]()
func animate() {
for val …Run Code Online (Sandbox Code Playgroud) 我正在使用这个正则表达式模式:@[a-zA-Z0-9-_]+匹配字符串中的@usernames.
嘿@alex,whatsup
@brian @mary很酷的照片
突出显示的文本grey是正则表达式模式返回的内容,但我希望它返回@字符后的所有内容.所以我真正想要的是:
嘿@ alex,whatsup
@ brian@ mary很酷的照片
我应该如何改变模式?