[TIMOB-1304] Android: Strange wrapping in TableView on Higher Res Screens
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:55:48.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 |
Components | Android |
Labels | android, defect |
Reporter | Don Thorp |
Assignee | Marshall Culpepper |
Created | 2011-04-15T02:48:57.000+0000 |
Updated | 2011-04-17T01:55:48.000+0000 |
Description
On the N1 the controls tab exhibits the problem.
See http://developer.appcelerator.com/question/38981/wrap-bug-in-labels--tableview"> Q&A for more information.
Also:
base UI>Views>Table Views (Go to P and see Pari with s on next line)
I vote +1 for fixing this!
Another example, KS -> Controls -> "Butto" with "n" wrapped
I think this is to do with auto-detecting the width. As a workaround, you can explicitly set a large enough width and the text won't wrap. Obviously, this is not ideal, though.
This is being worked on. It's a rounding error having to do with scaling and having int's instead of float in the API.
Thanks for the note, Don.
Another workaround is to change the fontsize. Increasing/decreasing by just one point can correct the problem
Sorry, mistake - I should not have re-assigned. Reassigning back to Marshall
(from [82d1161f123fb7a31699e07c8c76240471e46a4e]) grow the content area / auto generated label for tables, this fixes the text cutoff problem in higher-density devices [#1304 state:resolved] http://github.com/appcelerator/titanium_mobile/commit/82d1161f123fb7a31699e07c8c76240471e46a4e"> http://github.com/appcelerator/titanium_mobile/commit/82d1161f123fb...
Note: Using the latest Android build at http://builds.appcelerator.com.s3.amazonaws.com/mobile/mobilesdk-1.3.3-20100722034659-linux.zip"> http://builds.appcelerator.com.s3.amazonaws.com/mobile/mobilesdk-1....
Marshall
I'm afraid this bug is not completely fixed.
If you update the Kitchen Sink/Resources/examples/table_view_api_basic.js with the following code, you will see what I mean:
http://gist.github.com/485832">http://gist.github.com/485832
Cheers
Verified hal's test case.. The workaround I posted only really works in the "default" table view case, because it involves growing the content area of the default TableViewRow layout + The default label we create. AFAICT, This is still related to how fonts are measured when application scale is enabled, and looks very much like an actual Android bug.
Marshall, setting a static width for the container label could still cause the text to wrap in some cases where the margin between the text and the edge of the container is small. I feel when percentages for widths is working properly, it will allow a little bit of flexibility and flux to prevent this happening. Do you agree? Are percentages scheduled for the 1.5 release?
Full fix won't be ready in 1.4
Please, also have a look at labels within views. I have this issue there, too.
Jick
Marshall, the personable guy that he is, kindly explained to me via IRC that the issue of auto-sizing views within a tableviewrow is not so simple to resolve. Now I have some background, the reasons are more understandable. Here's the transcript:
Bearing in mind that there may not me a resolution soon, I think when dimensions in percentages work throughout the environment, they will provide a workaround to this in most situations.
The workaround for this is to use static sizes for now, with some supporting code to fix it in most cases. The root cause is android scaling (which can also be solved by setting anyDensity="false", and using Platform.displayCaps). Our new JSS support should also help alleviate density / resolution specific issues