[TIMOB-1013] table view row with text field and left > 35 = shift in table view on text field focus
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:54:57.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.4.0 |
Components | iOS |
Labels | n/a |
Reporter | Nolan Wright |
Assignee | Blain Hamon |
Created | 2011-04-15T02:41:30.000+0000 |
Updated | 2011-04-17T01:54:57.000+0000 |
Description
if the left property on the table view is 30 or less it does not
happen
code:
var win = Titanium.UI.createWindow();
function addRow()
{
var row = Ti.UI.createTableViewRow({height:50});
var tf1 = Titanium.UI.createTextField({
hintText:'Enter todo here',
color:'#336699',
height:45,
left:40,
width:280,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_NONE
});
row.add(tf1);
row.selectionStyle = Ti.UI.iPhone.TableViewCellSelectionStyle.NONE;
row.className = 'control';
return row;
}
// create table view data object
var data = [];
data[0] = addRow();
var tableView = Ti.UI.createTableView({
data:data,
style: Titanium.UI.iPhone.TableViewStyle.GROUPED
});
win.add(tableView);
win.open();
Yep, I've hit this too when embedding a text field on the right:
(if in landscape mode when you start editing, the table never returns until the user manually scrolls it back)
Okay, what's going on here in the first case is that the text field specified to have a width of 280, but it has a a left of 40, inside the tableRow (which has a margin of 10 inherent because it's a grouped style. So its frame in the window goes from x=40 to x=330. So in this case it's end developer error, as the scrolling to fit the text field in view is intentional; to solve this, have the width not be specified, and it'll be the remaining 260 pixels (there's a 10 pixel margin on the other side as well) automatically.
I'm looking into the landscape issue now.
(from [2f54f0ea7501b0b762f3742a2b6ee05767949932]) Closes #1013 by making ModifyScrollViewForKeyboardHeightAndContentHeightWithResponderRect compensate for being in landscape mode. http://github.com/appcelerator/titanium_mobile/commit/2f54f0ea7501b0b762f3742a2b6ee05767949932"> http://github.com/appcelerator/titanium_mobile/commit/2f54f0ea7501b...