這裏是我的代碼:翻譯紅寶石用於rubymotion
- (CGFloat)layoutManager:(NSLayoutManager *)layoutManager lineSpacingAfterGlyphAtIndex: (NSUInteger)glyphIndex withProposedLineFragmentRect:(CGRect)rect
{
return 20;
}
這裏是我的代碼:翻譯紅寶石用於rubymotion
- (CGFloat)layoutManager:(NSLayoutManager *)layoutManager lineSpacingAfterGlyphAtIndex: (NSUInteger)glyphIndex withProposedLineFragmentRect:(CGRect)rect
{
return 20;
}
def layoutManager(layoutManager, lineSpacingAfterGlyphAtIndex:glyphIndex withProposedLineFragmentRect:rect)
20
end
從這裏開始:http://www.rubymotion.com/developer-center/guides/getting-started/
已經通過了這本書和書。沒有那麼有用,iOS仍然讓我困惑,因爲我只有一個rails背景 –
我可以理解,我也經歷了這個......但是這個頁面上的幾個例子給你提供了將Objective-C方法轉換成Ruby的語法。 'application:didFinishLaunchingWithOptions'的例子。 – siekfried
應該是這樣的:
def layoutManager(layoutManager, lineSpacingAfterGlyphAtIndex: nil, withProposedLineFragmentRect: nil)
return 20.0
end
檢查the repo的例子。
此外,該方法應該返回一個浮點數,而不是一個int。
對你有好處,你有你的答案,但Stack Overflow不是代碼翻譯服務。 –
這不僅僅是他要求的翻譯。我確信他想知道什麼不適合他。 – Abdo
@Neil Slater所以,下次我應該在哪裏接受我的翻譯請求? –