Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1135] iOS: Ability to set font properties on a tableViewRow

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-04-30T17:48:41.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0, Sprint 2012-08
ComponentsiOS
Labelsapi, parity, qe-testadded
Reporterctredway
AssigneeNeeraj Gupta
Created2011-04-15T02:44:55.000+0000
Updated2013-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

  1. Paul Dowsett 2011-12-07

    See current Android behavior in screenshot in linked ticket
  2. 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
  3. Paul Dowsett 2011-12-07

    As per discussion with Don in IRC #appcelerator, this will need to be documented as Android-only.
  4. 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?
  5. 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.
  6. 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();
       
  7. Hidayet Dogan 2012-04-26

    By the way TIMOB-6504 is duplicate of this issue.
  8. Blain Hamon 2012-04-30

    Community pull request merged. Credit to https://github.com/hdogan
  9. Natalie Huynh 2012-06-07

    Tested with 2.1.0.v20120606162652 on iPod 3rd gen 4.0.2 and iPad Sim 5.1
  10. Shameer Jan 2013-12-10

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4940

JSON Source