Archived:TextFields cannot be added to the same row using MIDP 2.0 item shrinking layout directives in S60 (Known Issue)
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.
Article Metadata
Tested with
Devices(s): All S60 2nd and 3rd Edition devices
Compatibility
Platform(s): S60 2nd and 3rd Editions
Article
Created: User:Technical writer 1
(19 Oct 2007)
Last edited: hamishwillee
(28 Jun 2012)
Description
According to the Nokia Developer document MIDP 2.0: Introduction, two TextFields can be shrinked to fit on the same row by using the required layout directives LAYOUT_SHRINK and LAYOUT_2 in devices supporting MIDP 2.0. However, when using the directives as defined in the document, TextFields will be placed on different rows.
How to reproduce
The problem can be reproduced by using the following example code as defined in the document MIDP 2.0: Introduction (Section 2.7.2, "Layouts"):
private TextField tfAreacode; // Areacode
private TextField tfNumber; // Phone number
...
// Create text message and commands
tfAreacode = new TextField("Phone:", null, 3, TextField.NUMERIC);
tfAreacode.setLayout(Item.LAYOUT_SHRINK | Item.LAYOUT_2);
tfNumber = new TextField(null, null, 7, TextField.NUMERIC);
tfNumber.setLayout(Item.LAYOUT_SHRINK | Item.LAYOUT_2);
Solution
No known solution. Current S60 MIDP implementations ignore these directives and do not add more than one Item on the same row.


(no comments yet)