我有很多不同大小的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)
除了我的朋友们模糊之外,一切都很好.如果我不将它们居中,那就非常尖锐.它们都是用曲线制成的.我没有全部导出它们,所以仍然有机会以固定大小导出并且图纸已经居中,但我想知道我做错了什么或不完整.他们为什么模糊?
我想这里不能上传任何照片..
我有这个大表没有错误的工作,即使我看起来比从下载的例子打开的更复杂的单元格太慢了.问题来自我点击一个单元格,然后回来,在几秒钟内快速滚动应用程序崩溃在该行: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) 首先,我阅读了如何删除分支,但由于某种原因不适用于我的项目: 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)
我只想要主分支。
我正在建立一个小状态栏应用程序,当我点击它显示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)
此外,如果我在一小段延迟后模拟图标按下它的工作原理.
我有这个正则表达式有效:
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
有任何想法吗?谢谢