[TIMOB-1135] iOS: Ability to set font properties on a tableViewRow
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-30T17:48:41.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Release 2.1.0, Sprint 2012-08 |
Components | iOS |
Labels | api, parity, qe-testadded |
Reporter | ctredway |
Assignee | Neeraj Gupta |
Created | 2011-04-15T02:44:55.000+0000 |
Updated | 2013-12-10T05:51:29.000+0000 |
Description
This was first asked in Q & A and then submitted by a premium customer. Users want to be able to set font properties on a table without needing to use a label.
Q&A question:
http://developer.appcelerator.com/question/33581/bug-table-row-font-doesnt-work-on-iphone#header">
http://developer.appcelerator.com/question/33581/bug-table-row-font...
Things to be able to set are size, font weight, and font.
Comments
- Paul Dowsett 2011-12-07 See current Android behavior in screenshot in linked ticket
- Paul Dowsett 2011-12-07 Note that the native feature was deprecated in iOS3. See http://developer.apple.com/library/IOs/#documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html
- Paul Dowsett 2011-12-07 As per discussion with Don in IRC #appcelerator, this will need to be documented as Android-only.
- Hidayet Dogan 2012-02-19 I've checked TiUITableViewRowProxy.m file and found that it uses textLabel for "title" property which is UILabel. So UILabel can have "font" property which is not deprecated. Am I wrong?
- Hidayet Dogan 2012-02-19 There was a pull request for the issue but commit-er does not interested in the project anymore. I've re-organized the code and made a pull request. See: https://github.com/appcelerator/titanium_mobile/pull/1466 Tested with iOS 5 SDK on iPhone Simulator.
- Hidayet Dogan 2012-04-26
Updated pull request with latest master and made changes about rolling back to system default font if it's not given.
Tested with:
Titanium SDK version: 2.1.0 (04/26/12 12:38 9bd4b97)
iPhone SDK version: 5.1
Here is the function test code:
Titanium.UI.setBackgroundColor('white'); var window = Titanium.UI.createWindow(); var table = Titanium.UI.createTableView(); var row1 = Titanium.UI.createTableViewRow({ title: 'Custom font #1', font: { fontSize: 12, fontWeight: 'bold' }, color: '#ff0000' }); var row2 = Titanium.UI.createTableViewRow({ title: 'Default System Font' }); var row3 = Titanium.UI.createTableViewRow({ title: 'Custom font #2', font: { fontSize: 16, fontStyle: 'italic' }, color: '#00ff00' }); var row4 = Titanium.UI.createTableViewRow({ title: 'Default System Font' }); var row5 = Titanium.UI.createTableViewRow({ title: 'Custom font #3', font: { font: 'TrebuchetMS', fontSize: 20 }, color: '#00d' }); table.setData([row1, row2, row3, row4, row5]); window.add(table); window.open();
- Hidayet Dogan 2012-04-26 By the way TIMOB-6504 is duplicate of this issue.
- Blain Hamon 2012-04-30 Community pull request merged. Credit to https://github.com/hdogan
- Natalie Huynh 2012-06-07 Tested with 2.1.0.v20120606162652 on iPod 3rd gen 4.0.2 and iPad Sim 5.1
- Shameer Jan 2013-12-10 Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4940