小编Saj*_*jad的帖子

在Visual Studio代码中禁用工具提示提示

如何在vscode上禁用默认工具提示提示消息?这有点烦人了.

在此输入图像描述

visual-studio-code vscode-settings

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

Flexbox中的第一个孩子全宽

如何在flexbox全宽中设置first-child,将其他所有子设置为flex:1(对于拆分空间)?

像这样:

在此输入图像描述

css flexbox

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

无法在swift 2中转换类型'[NSLayoutConstraint]'错误的值

我想UIImageView通过添加以下代码行来添加约束:

addConstraint(NSLayoutConstraint.constraintsWithVisualFormat("H:|[v0]|", options: NSLayoutFormatOptions(), metrics: nil, views: ["v0": userProfileImageView]))
Run Code Online (Sandbox Code Playgroud)

但是xcode告诉我这个错误:

在此输入图像描述

我该如何解决这个错误?

ios nslayoutconstraint swift swift2

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

在swift中将阴影应用于导航栏

在我的设计导航的应用程序有很好的阴影,我想在我的代码中应用.如何才能创造出这种效果?

在此输入图像描述

ios swift

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

"`pod repo update`没有发生"CocoaPods中的错误

我从其网站下载并安装CocoaPods,我的pod版本是pod --version 1.0.0.

当我想安装Alamofire或swiftJSON时,例如,将它们添加到我的podfile并运行 pod install

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target 'random contact' do
  pod 'Alamofire', '~> 3.4'
  pod 'SwiftyJSON'
end
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

Analyzing dependencies
[!] Unable to satisfy the following requirements:

- `Alamofire (~> 3.4)` required by `Podfile`

None of your spec sources contain a spec satisfying the dependency: `Alamofire (~> 3.4)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update`.
 * mistyped the name or version.
 * not added …
Run Code Online (Sandbox Code Playgroud)

ios cocoapods swift

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

我如何模块化静态HTML文件?

我是一名前端开发人员.当我编写html代码时,我通过复制和粘贴(标题部分,页脚部分等)重复我自己.

我怎么写模块化我的html文件?像独立的header.htmlfooter.html,都在通话后index.html...一样erbRuby on rails?(我不喜欢jade郎)

html javascript ruby-on-rails erb gulp

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

像Atl中的sublimetext一样软包装

为什么Atom不能像sublime文本那样软包装代码?我想要全屏代码但是软包装.这意味着行尾和近距离小地图切割线.我怎么能在原子中做到这一点?

在此输入图像描述

text-editor sublimetext atom-editor

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

如何在HTML中重复div元素n次?

如何复制一个<div>使用JavaScript的n份副本?

从1开始:

<div class="box"></div>
Run Code Online (Sandbox Code Playgroud)

最终得到5:

<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
Run Code Online (Sandbox Code Playgroud)

html javascript jquery dom

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

错误忽略“宝石名称”,因为其扩展名不是内置的

我通过rbenv安装ruby 2.2.3并安装rails 4.2.1

当我想通过rails -v显示在终端中查看Rails版本时:

Ignoring json-1.8.2 because its extensions are not built.  Try: gem pristine json --version 1.8.2
Ignoring json-1.8.3 because its extensions are not built.  Try: gem pristine json --version 1.8.3
Ignoring nokogiri-1.6.6.2 because its extensions are not built.  Try: gem pristine nokogiri --version 1.6.6.2
Rails 4.2.1
Run Code Online (Sandbox Code Playgroud)

或通过rails new app向我展示此新应用来创建新应用:

Ignoring json-1.8.2 because its extensions are not built.  Try: gem pristine json --version 1.8.2
Ignoring json-1.8.3 because its extensions are not built.  Try: gem …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails ruby-on-rails-3

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

如何在表单中使用带有自定义控件的ngModel?

我创建了一个用于处理选择框的组件,现在当我在提交表单后将其放在表单标签中时,选择的结果不会显示在控制台中.

我的代码有什么问题?我怎样才能解决这个问题?

  • testOption:是我传递的对象数组,抛出选择框@Input.

这是选择框组件:

import { Component, OnInit, Input } from '@angular/core';

@Component({
    selector: 'input-select',
    template:`
      <div class="field-select">
        <span><icon name="select-arrow" size="10"></icon></span>
        <select name="{{name}}" class="field">
          <option value="0" disabled selected>{{label}}</option>
          <option *ngFor="let option of options" [ngValue]="option.value">{{option.name}}</option>
        </select>
      </div>
    `
})
export class InputSelectComponent implements OnInit {
    @Input() label: string;
    @Input() name: string;
    @Input() options;


    // testOptions = [
    //   {value:'test',name:'test2'},
    //   {value:'test',name:'test2'}
    // ];

    constructor() { }

    ngOnInit() {
      console.log(this.options);
     }

}
Run Code Online (Sandbox Code Playgroud)

在html中的用法:

<input-select label="test" name="select2" [options]="testOption"></input-select>
Run Code Online (Sandbox Code Playgroud)

表格html:

<form role="form" …
Run Code Online (Sandbox Code Playgroud)

angular2-forms angular2-template angular

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

TabBar图标反弹对选择的影响,例如Swift中的Twitter应用程序

当我点击其中一个时,如何创建类似Twitter应用程序的标签栏图标弹跳效果?看起来像按比例缩小,然后又恢复正常。

在此处输入图片说明

谢谢。

uitabbarcontroller uitabbaritem uitabbar ios swift

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

SSH每次都要求密码短语

我的私钥有一个恼人的问题.每次我想要clonepush通过终端或塔式应用程序中的ssh,我都要输入我的密码.

我甚至删除并重新创建了ssh密钥并在Github上设置了几次密钥,但看起来它的生命周期很短,几分钟后就过期了!

我跟着生成了一个新的SSH密钥来创建密钥.最后我跑了ssh-add ~/.ssh/id_rsa,打印出来:

Identity added: /Users/sajad/.ssh/id_rsa (/Users/sajad/.ssh/id_rsa)
Run Code Online (Sandbox Code Playgroud)

重新启动机器后,我跑去ssh-add -l检查它是否仍然存在,结果如下:

The agent has no identities.
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?我用macOS.

我的/etc/ssh/ssh_config:

#   $OpenBSD: ssh_config,v 1.30 2016/02/20 23:06:23 sobrado Exp $

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is …
Run Code Online (Sandbox Code Playgroud)

git ssh terminal github git-tower

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

从child angular2中的父级访问变量

我的父组件中有一个变量,我想在我的子组件中编辑.我尝试@Input但似乎没有用!我怎样才能实现传递var给孩子并听取改变?

家长:

export class Parent implements OnInit {
    showModal : boolean = false;
}
Run Code Online (Sandbox Code Playgroud)

儿童:

export class Child implements OnInit {
    @Input() showModal: boolean;

    // calling this function on (click) button.
    closeModal() {
      this.showModal = false;
    }
}
Run Code Online (Sandbox Code Playgroud)

谢谢.

angular

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