GithubHelp home page GithubHelp logo

Comments (11)

avaidyam avatar avaidyam commented on June 26, 2024

Mmm, mind posting the code you used to configure this? (Partially because I haven't been able to get it to work either, and partially to help you :D)

from twui.

devon avatar devon commented on June 26, 2024

I tried the latest example from twui, it works. I use and old twui branch(before ARC). I'm trying to figure it out.

from twui.

avaidyam avatar avaidyam commented on June 26, 2024

Wait, is it enabled automatically? Doesn't seem to do that for me...

from twui.

devon avatar devon commented on June 26, 2024

Yeah, it enabled automatically. git clone the latest version from https://github.com/twitter/twui.git, and run the example project.

from twui.

avaidyam avatar avaidyam commented on June 26, 2024

Oh, I see. I will indeed do that. Was the triple-tap define on the table view cell labels?

from twui.

devon avatar devon commented on June 26, 2024

Yeah, triple-tap on the table view, it will show up the dictionary. I think it's related to TUITextRenderer

from twui.

avaidyam avatar avaidyam commented on June 26, 2024

Alright, will look into that and get back to you. I'm on a desktop at the moment, but tomorrow I'll test it on an MBP running 10.7.3.

from twui.

devon avatar devon commented on June 26, 2024

I found the problem. Cannot popup the dictionary when add line height to TUIAttributedString.

ExampleTableViewCell *cell = reusableTableCellOfClass(tableView, ExampleTableViewCell);

TUIAttributedString *s = [TUIAttributedString stringWithString:[NSString stringWithFormat:@"good news cell %d", indexPath.row]];
s.color = [TUIColor blackColor];
s.font = exampleFont1;
s.lineHeight = 3;  // Add the line will see the problem
[s setFont:exampleFont2 inRange:NSMakeRange(8, 4)]; // make the word "cell" bold
cell.attributedString = s;

return cell;

from twui.

avaidyam avatar avaidyam commented on June 26, 2024

Considerably faster than I could, I see. Now that we know that the issue is here, I can look into fixing it. Thanks!

from twui.

devon avatar devon commented on June 26, 2024

Change the setLineheight to use the default method solve the problem, but i'm not sure is this a good solution for this:

- (void)setLineHeight:(CGFloat)f inRange:(NSRange)range
{
    // CTParagraphStyleSetting setting;
    // setting.spec = kCTParagraphStyleSpecifierLineSpacing;
    // setting.valueSize = sizeof(CGFloat);
    // setting.value = &(CGFloat){f};

    // CTParagraphStyleRef paragraphStyle = CTParagraphStyleCreate(&setting, 1);
    // [self addAttributes:[NSDictionary dictionaryWithObjectsAndKeys:(id)paragraphStyle, kCTParagraphStyleAttributeName, nil] range:range];
    // CFRelease(paragraphStyle);
    NSMutableParagraphStyle *p = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
    [p setLineSpacing:f];
    [self addAttributes:[NSDictionary dictionaryWithObjectsAndKeys:(id)p, kCTParagraphStyleAttributeName, nil] range:range];
    [p release];
}

from twui.

joshaber avatar joshaber commented on June 26, 2024

This is fixed after merging #107

from twui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.