[TIMOB-539] Text anti-aliasing on tableView labels after scrolling back on to the screen
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:53:26.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.3.0 |
Components | iOS |
Labels | defect, ios, iphone, label, tableview, text |
Reporter | kosso |
Assignee | Blain Hamon |
Created | 2011-04-15T02:31:24.000+0000 |
Updated | 2011-04-17T01:53:26.000+0000 |
Description
Hi,
I've seen this happen a few times. When I load at the vertical layout demo in KS (on indeed my own app which uses this layout) the text labels are nice and crisp.
If I then scroll the rows up out of view - and then back in to view, the text is slightly blurred. (Called anti-aliasing)
I have a feeling this is happening when the row is repainted as it comes back in to view and the calculations for the rowheight might be float values, instead of integers (as we use when we set positions for our labels - in whole numbers)
The reason I think it's this, is that this used to happen a lot with Flash development - especially with certain types of text. We had to make sure the positioning of the text was exactly 'on the pixel'.
Probably this could be easily fixed (by Blain?) in TiUITableViewRowProxy.m ?? :)
Attachments
File | Date | Size |
---|---|---|
blurring.jpg | 2011-04-15T02:31:24.000+0000 | 213277 |
tableview_blurringjs.zip | 2011-04-15T02:31:24.000+0000 | 3887 |
I am encountering this problem regularly.
It only happens for labels added to table view rows - not for native
title
text.Whether it happens for a particular label appears to be influenced by the extent to which the label text is constrained by
top
,bottom
,left
,right
,width
andheight
.Setting both
left
andright
in conjunction withwidth:auto
seems to create the problem, but sometimes it's okay if you only set two of those three properties (which then precludes some complex layouts).thanks for this info.
I tried just using 2 settings - an absolute left and an auto height (with textAlign:left) and I still the blurring when the row comes back in to view after scrolling off.
I'm also placing my labels etc. in the row within a vertical layout view.
Should be fixed by #722. Please test.
Hi,
I'm still seeing it happen after building the latest 1.2.0 today.
Oddly, I'm sometimes seeing it blurred before scrolling offscreen, then sharpening up after scrolling off and on again.
I've also tried setting my labels to even number positions and widths.
Also bear in mind (if it's worth mentioning) that I use these labels (of varying fontSize and fontWeight, though I have tried setting fontSize to even numbers too) in a tableView WITHIN a 'vertical' layout view (with 'auto' height) - and usually with textAlign left - WITHIN each tableViewRow
See the attached image, where the top three rows have been scrolled out and then in to view.
The titles have got blurred, yet the 'time ago' labels have got sharper.
There is a chance that this is also related to #709. TableRowViews are handled differently than other views because they are dynamically loaded. Keep this a separate issue from #722.
Please provide me with some sample code so that I can replicate the problem.
Hi Stephen.
Here you go. See attached zip. (I have removed some of the functionality of this page in my app - which loads some JSON from my server and displays a tableView. You should be able to load it fine though)
Scroll the rows up and down and you should see the effects on the various labels used.
thx
Kosso
(from [e4650d92e0a3192a758e8fae9ea38001f6bc529c]) Closes #539. Bounds/Frames for UILabels always need to be on integer boundaries in the largest possible frame of reference. http://github.com/appcelerator/titanium_mobile/commit/e4650d92e0a3192a758e8fae9ea38001f6bc529c"> http://github.com/appcelerator/titanium_mobile/commit/e4650d92e0a31...
I'm still seeing this occur in places where left, right, height, top or bottom are odd numbers (with textAlign right or left) - in places like vertical layout scrollViews, tableViews, activityIndicator messages and others.
Making sure things are on even numbers seems to help.
It's got much better though. ;)