小编Tie*_*eme的帖子

为什么存储表示为2次提交?

当存储一些更改时,Git会创建两个单独的提交,"分支上的WIP"和"分支上的索引":

$ git log --graph --all 

*   commit 98aac13303ca086580c1ec9ccba5fe26c2a8ef3c
|\  Merge: 7d99786 82c5c76
| | Author: Tieme <my@email.com>
| | Date:   Wed Nov 19 09:58:35 2014 +0100
| |
| |     WIP on development: 7d99786 Last real commit
| |
| * commit 82c5c763357c401135675a39bfabf9b7f6805815
|/  Author: Tieme <my@email.com>
|   Date:   Wed Nov 19 09:58:35 2014 +0100
|
|       index on development: 7d99786 Last real commit
|
|
| * commit 7d9978637a0e1ef92f2432189bdebf2317f0b2f0
| Author: Tieme <my@email.com>
| Date:   Tue Nov 18 …
Run Code Online (Sandbox Code Playgroud)

git git-stash git-log

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

我可以在没有动画的情况下更改strokeEnd属性吗?

我似乎无法从strokeEnd我的CAShapeLayer 的属性中删除动画.

该文档说该属性animatable但默认情况下没有动画,我无法查明问题.有什么建议去哪儿看?

这是我的代码:

class ViewController: UIViewController {

    let circle = CAShapeLayer()

    override func viewDidLoad() {
        super.viewDidLoad()

        // Circle
        circle.fillColor = UIColor.clearColor().CGColor
        circle.strokeColor = UIColor.blackColor().CGColor
        circle.lineWidth = 10
        circle.strokeEnd = 0
        circle.lineJoin = kCALineJoinRound
        circle.path = UIBezierPath(ovalInRect: CGRectMake(60, 140, 200, 200)).CGPath
        circle.actions = ["strokeEnd" : NSNull()]

        // Show Button
        let showButton = UIButton(frame: CGRectMake(40, 40, 240, 40))
        showButton.addTarget(self, action: "showButton", forControlEvents: UIControlEvents.TouchUpInside)
        showButton.setTitle("Show circle", forState: UIControlState.Normal)
        showButton.backgroundColor = UIColor.greenColor()

        // Add to view
        self.view.layer.insertSublayer(circle, atIndex: 1) …
Run Code Online (Sandbox Code Playgroud)

cashapelayer ios swift

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

UIWebView和定义字典

我有使用UIWebView内置的复制和定义选项.它在iPad上工作得很好,但在iPhone上,只有当我突出显示文本并使用字典并且第二次尝试它时,它只能工作一次,它不显示弹出窗口.任何的想法?

更新:当 我解除iPhone上的字典时,我也收到以下错误:UIFallbackPresentationViewController的开始/结束外观转换的不平衡调用

更新: 当我提出UIAlertView并取消它时,字典再次起作用.想知道为什么?

iphone cocoa-touch objective-c uiwebview ios

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

我在哪里可以找到生产中的Electron应用程序的日志?

我用Electron构建了一个应用程序,并使用Electron-Builder创建了一个Squirrel windows安装程序和更新程序.这一切都很好,但我在调试我的应用程序的生产版本时遇到问题.

console.log使用生产版本时,是否在磁盘上的某处写入了日志?如果是这样,我在哪里可以找到它们?或者在编译可执行文件时是否全部删除了?我的应用必须有某种日志文件吗?

我发现了SquirrelSetupLog,C:\Users\Tieme\AppData\Local\MyApp\SquirrelSetupLog但这还不足以调试我的生产问题.


刚遇到电子日志.如果常规控制台日志确实没有写入磁盘某处,那可能会有效.

logging electron squirrel.windows electron-builder

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

如何让源图为React Css模块工作?

我试图建立一个阵营与项目react-css-modules,的WebPack热模块的更换.一切都像魅力一样,但我不能让CSS源图工作.

我按照本指南制作了HMR.它涉及一个BrowserSync设置,用于在Webpack将其写入磁盘后更新css文件.

我使用(如react-css-modules建议)ExtractTextPlugin来提取所有的css:

{
    test: /\.scss$/,
    loader: ExtractTextPlugin.extract('style','css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass')
}
Run Code Online (Sandbox Code Playgroud)

但是,如果我将其更改为源图,如此处所示

loader: ExtractTextPlugin.extract('style', 'css?sourceMap!sass-loader outputStyle=expanded&sourceMap=true&sourceMapContents=true')
Run Code Online (Sandbox Code Playgroud)

我收到错误:"root" CSS module is undefined.在我的浏览器控制台中.

你可以在这里找到我的示例repo ,但这里是我用于开发的完整webpack配置.

var webpack = require('webpack');
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var WriteFilePlugin = require('write-file-webpack-plugin').default;

module.exports = {
  entry: {
    bundle: [
      'webpack/hot/dev-server',
      'webpack-hot-middleware/client',
      './index.js'
    ]
  },
  devtool: 'cheap-module-source-map',
  debug: true,
  devServer: devServer,
  context: path.resolve(__dirname, './src'),
  output: {
    path: path.resolve(__dirname, './builds'),
    filename: '[name].js', …
Run Code Online (Sandbox Code Playgroud)

reactjs webpack css-modules webpack-hmr react-css-modules

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

如何在iOS 11上的iPhone X上获得黑色状态栏

默认情况下,iPhone X上的状态栏如下所示:

在此输入图像描述

但我想实现这个目标:

在此输入图像描述

我尝试设置preferredStatusBarStylelightContent但只有在将状态栏后面的背景设置为黑色后才能使用.

为了修复圆角,我最后添加了另一个圆角的子视图.

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        view.backgroundColor = .black

        let roundedView = UIView(
            frame: CGRect(
                x: 0,
                y: UIApplication.shared.statusBarFrame.height,
                width: view.frame.width,
                height: view.frame.height
            )
        )
        roundedView.layer.cornerRadius = 10
        roundedView.layer.masksToBounds = true
        roundedView.backgroundColor = .white
        view.addSubview(roundedView)

        let label = UILabel(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 60))
        label.text = "Black statusbar!"
        label.textAlignment = .center
        roundedView.addSubview(label)
    }

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }
}
Run Code Online (Sandbox Code Playgroud)

我想知道这是否是最好的方法..必须有更好的方法来实现这一目标.


UPDATE

这是一个可怕的想法,因为: …

statusbar ios swift safearealayoutguide iphone-x

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

在多个子类之间共享storyboard viewcontroller

我和佩德罗在这里有同样的问题,但对答案不满意,因为已经有了奖励和奖励,我创造了这个问题,我会尽快添加赏金.

我想在代码中创建或操作segue(以黄色突出显示),以便主视图是MFMasterViewController(以红色突出显示)的多个子类中的任何一个.

故事板图

做这个时使用笔尖我可以创建一个笔尖,SharedNib.xib和设置类的MFMasterViewController,然后创建我的子类,比方说 MFMasterViewControllerSubclassA,MFMasterViewControllerSubclassB 等和然后实例化我想要使用哪个子...

MFMasterViewControllerSubclassA *controller = [[MFMasterViewControllerSubclassA alloc] initWithNibName:@"SharedNib" bundle:nil];
Run Code Online (Sandbox Code Playgroud)

要么...

MFMasterViewControllerSubclassB *controller = [[MFMasterViewControllerSubclassB alloc] initWithNibName:@"SharedNib" bundle:nil];
Run Code Online (Sandbox Code Playgroud)

等等

关于如何使用故事板来解决这个问题的任何线索?

我不能在Pedro的问题上使用提供的答案,我的子类扩展超出了数据源和委托.

cocoa-touch ios uistoryboard uistoryboardsegue

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

Firefox中的字体平滑

使用Google WebFonts(在本例中为"Oswald"),我发现我的字体比它们应该更大胆.我使用以下方法在基于webkit的浏览器中解决了这个问题

-webkit-font-smoothing: antialiased;
Run Code Online (Sandbox Code Playgroud)

但在Firefox中我找不到控制它的声明.我听说使用text-shadow黑客来解决这个问题,但我不想使用它,因为它无疑会改变字体的几何属性.

以下是webkit(Chrome)中的内容:

Chrome看起来不错

这是由于Firefox的块状可怕渲染:

火狐难看

我知道有一种方法可以在FireFox中实现这一点,因为我在font-combinator.com上找到了这个字体,并且它使用Firefox在font-combinator上正确呈现.以下是通过font-combinator.com在Firefox上看起来的样子:

在Font-combinator.com上使用firefox

在浏览用于创建font-combinator的css之后,我发现了这个声明:text-rendering: optimizelegibility;但是当应用于我的元素时这不起作用.

我也尝试过:

text-rendering: optimizeLegibility;
text-rendering: geometricPrecision;
font-smooth: always;
font-smooth: never;
font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
Run Code Online (Sandbox Code Playgroud)

我怎样才能让Firefox对我的字体进行抗锯齿处理,以便它们在显示时看起来正确?您能找到使它们在www.font-combinator.com上正确显示的声明或声明组合吗?

我使用的是相对旧版本的FireFox(16.0.2),因为这台机器安装了旧版本的OSX.

css macos firefox fonts rendering

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

索引和长度必须指向字符串中的位置.参数名称:长度

我收到这个错误:

Index and length must refer to a location within the string.
Parameter name: length
Run Code Online (Sandbox Code Playgroud)

使用此代码:

string a1 = ddlweek.Text.Substring(0, 8);                
string a3 = ddlweek.Text.Substring(10, 14);
Run Code Online (Sandbox Code Playgroud)

这是什么意思?

asp.net

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

Symbol not found when building App including MapKit

When using the new Xcode 11 beta. I'm getting the following crash while running my app that uses MapKit. Xcode 10 works fine. Also creating a new project and adding a Map with Mapkit works fine.

A simple web search doesn't yield anything.

Any clues where to look to solve this problem?

Xcode 11 beta 1:

dyld: Symbol not found: _NavigationConfig_MapLocalizeLabels
  Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MapKit.framework/MapKit
  Expected in: /Users/Teameh/Library/Developer/Xcode/DerivedData/MyApp-dejdjcwzzweszweqllhjxqbarbsp/Build/Products/Debug-iphonesimulator/Navigation.framework/Navigation
 in /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MapKit.framework/MapKit
Run Code Online (Sandbox Code Playgroud)

Xcode 11 beta 3:

dyld: Symbol not found: _NavigationConfig_MapLocalizeLabels
  Referenced from: …
Run Code Online (Sandbox Code Playgroud)

mapkit swift ios13 xcode11

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