Comments (11)
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.
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.
Wait, is it enabled automatically? Doesn't seem to do that for me...
from twui.
Yeah, it enabled automatically. git clone the latest version from https://github.com/twitter/twui.git, and run the example project.
from twui.
Oh, I see. I will indeed do that. Was the triple-tap define on the table view cell labels?
from twui.
Yeah, triple-tap on the table view, it will show up the dictionary. I think it's related to TUITextRenderer
from twui.
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.
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.
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.
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.
This is fixed after merging #107
from twui.
Related Issues (20)
- TUITableView cell queue fix HOT 2
- TUIControl tracking and events HOT 2
- TUIImage for animated gif? HOT 3
- Lots of commits recently... time to spin a new release? HOT 2
- compile error HOT 2
- A "getting started" guide would be great HOT 12
- TUIPopover issues HOT 5
- Goal of twui ? HOT 2
- Core Layout HOT 7
- Missing features + updates HOT 3
- UIKit / iOS support? HOT 7
- Vector Graphics HOT 9
- Appearances
- Table view cell drawing not updated correctly. HOT 1
- Crash when window is released
- TUIScrollView - Indicators not visible while dragging when set to show while scrolling HOT 1
- TUILabel - jagged text when background color is clearColor HOT 3
- TUIImage imageName could not accept image name without extention
- Scroll View in reverse? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twui.