小编Cri*_*uță的帖子

居中的图像很模糊

我有很多不同大小的png,我想将它们加载到一个表中.我有这个代码:

charImage.image = [self imageForId:g.charId glyphNr:g.glyphNr];
[charImage sizeToFit];
//charImage.contentMode = UIViewContentModeCenter;
charImage.center = CGPointMake(30, 23);
Run Code Online (Sandbox Code Playgroud)

除了我的朋友们模糊之外,一切都很好.如果我不将它们居中,那就非常尖锐.它们都是用曲线制成的.我没有全部导出它们,所以仍然有机会以固定大小导出并且图纸已经居中,但我想知道我做错了什么或不完整.他们为什么模糊?

我想这里不能上传任何照片..

iphone objective-c

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

为什么我的应用程序崩溃了?UITable和控制器

我有这个大表没有错误的工作,即使我看起来比从下载的例子打开的更复杂的单元格太慢了.问题来自我点击一个单元格,然后回来,在几秒钟内快速滚动应用程序崩溃在该行:charImage.image = [self imageForIndex:ch.charId];

如果我删除它会在下一行崩溃: titleLabel.text = ch.title;

有人熟悉这个吗?谢谢.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//NSLog(@"add a new cell at index path %@", indexPath);
// Each subview in the cell will be identified by a unique tag.
static NSUInteger const kTitleLabelTag = 2;
static NSUInteger const kCharImageTag = 3;
static NSString *kCellID = @"CellID";

// Configure the cell


// Declare references to the subviews which will display the char data.
UILabel *titleLabel = nil;
UIImageView *charImage = nil; …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch objective-c

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

删除github分支

可能重复:
如何在本地和 Github 中删除 Git 分支?

首先,我阅读了如何删除分支,但由于某种原因不适用于我的项目: https: //github.com/ralcr/sdk.ralcr

当您第一次进入此处时,您会在 gh-pages 分支中看到一些 10 个月前的文件。我不知道这个分支是如何创建的以及为什么它首先显示,但我想删除它,但这不起作用

Balutas-MacBook-Pro:sdk.ralcr Cristi$ git push origin --delete gh-pages
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

我只想要主分支。

git branch github

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

有时,NSPopover错误的位置,在El Capitan

我正在建立一个小状态栏应用程序,当我点击它显示NSPopover的图标.一切正常,直到我升级到El Capitan.问题是当我第一次启动应用程序时,我模拟状态栏图标自动按下,因为我想看到弹出框,它出现在屏幕的左下角.关闭它并再次打开后,它从屏幕顶部显示正常.你觉得有什么不对吗?这是代码,当我在showPopover中打印值时没有错

private let menu = MenuBarController()

override init() {
    super.init()

    self.menu.onMouseDown = {
        if (self.menu.iconView?.isSelected == true) {
            self.showPopover()
        } else {
            self.hidePopover()
        }
    }
}
func showPopover() {
    let icon = self.menu.iconView!
    let edge = NSRectEdge.MinY
    let rect = icon.frame
    self.popover?.showRelativeToRect(rect, ofView: icon, preferredEdge: edge);
}
func applicationDidFinishLaunching(aNotification: NSNotification) {
    let icon = self.menu.iconView!
    icon.mouseDown(NSEvent())
}
Run Code Online (Sandbox Code Playgroud)

此外,如果我在一小段延迟后模拟图标按下它的工作原理.

macos nspopover swift

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

使用ocaml regexp的麻烦,基本模式不起作用

我有这个正则表达式有效:

Str.string_match (Str.regexp "[0-9][0-9][0-9][0-9]\\.[0-9][0-9]\\.[0-9][0-9]") dir 0
Run Code Online (Sandbox Code Playgroud)

但我想简化它,它根本不起作用

"\\d{4}\\.\\d{2}\\.\\d{2}"
Run Code Online (Sandbox Code Playgroud)

还有其他的尝试使它工作,但我得出的结论是它有d,{}甚至与分组字符()的麻烦这种模式工作在任何其他语言,甚至在这个庞大的示例列表中使用http ://pleac.sourceforge.net/pleac_ocaml/patternmatching.html

有任何想法吗?谢谢

regex ocaml

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

标签 统计

iphone ×2

objective-c ×2

branch ×1

cocoa-touch ×1

git ×1

github ×1

macos ×1

nspopover ×1

ocaml ×1

regex ×1

swift ×1