Skip to content

Instantly share code, notes, and snippets.

@tikidunpon
Created June 6, 2013 13:54
Show Gist options
  • Save tikidunpon/5721675 to your computer and use it in GitHub Desktop.
Save tikidunpon/5721675 to your computer and use it in GitHub Desktop.
SECoreTextで「改行付近の文字が描画されない事がある」問題の再現サンプル
- (void)viewDidLoad
{
[super viewDidLoad];
/**
* 以下のいずれのケースでも末尾の数文字が描画されない
* 改行後数文字は描画されず、文字を増やすと描画される事がある。
*/
SETextView *textView = [[SETextView alloc] initWithFrame:CGRectMake(10, 5, 294, 130)];
//SETextView *textView = [[SETextView alloc] initWithFrame:CGRectMake(0, 0, 294, 130)];
//SETextView *textView = [[SETextView alloc] initWithFrame:CGRectMake(0, 0, 320, 130)];
textView.backgroundColor = [UIColor orangeColor];
textView.lineSpacing = 7.5f;
textView.font = [UIFont systemFontOfSize:14.0f];
textView.delegate = self;
[textView setSelectable: NO];
textView.textAlignment = NSTextAlignmentLeft;
textView.text = @"あいうえおかきくけこさしすせそたちつてとなにぬねのあいうえおかきくけこさしすせそたちつてとなにぬねのあいうえおかきくけこさしすせそたちつてと";
[textView sizeToFit];
[self.view addSubview:textView];
}
@tikidunpon
Copy link
Author

lineSpaceingに小数値が入ると発生していたとの事、
最新Verでは少数値を丸める事で対応されています。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment