Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-7794] set view as outerview #5048

Conversation

bijupmb
Copy link
Contributor

@bijupmb bijupmb commented Dec 2, 2013

@ghost ghost assigned pingwang2011 Dec 3, 2013
@@ -500,7 +500,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
h = Math.max(h, Math.max(content.getMeasuredHeight(), Math.max(leftImageHeight, rightImageHeight)));
h = Math.max(h, minRowHeight);
} else {
h = Math.max(minRowHeight, height.getAsPixels(this));
h = Math.max(minRowHeight, height.getAsPixels(table.getOrCreateView().getOuterView()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not make sense to use the table height as the row height.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for calculating the percentage of height we need the parent view right ?
which we use other than this ?

me use the test case bellow that is working fine

var win=Ti.UI.createWindow();
var tableview=Ti.UI.createTableView({
backgroundColor:'blue'
});
var tableviewrow=Ti.UI.createTableViewRow({
height:'50%',
backgroundColor:'red'
});
var btn = Ti.UI.createButton({
title : '100 %',
height:'100',
width : '150' , top : '110'

});

var btn1 = Ti.UI.createButton({
title : '25 %',
height:'100',
width : '150' , top : '10'

});
var btn300 = Ti.UI.createButton({
title : '300',
height:'100',
width : '150' , top : '210'

});
tableview.setData([tableviewrow]);
win.add(tableview);
win.add(btn);
win.add(btn1);
win.add(btn300);
btn.addEventListener('click', function() {
// Check console
tableviewrow.height = '100%'
});
btn1.addEventListener('click', function() {
// Check console
tableviewrow.height = '25%'
});
btn300.addEventListener('click', function() {
// Check console
tableviewrow.height = '300'
});
win.open();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need the dimension of the parent view to calculate the row height. But the solution is not just simply assigning the row height as the table view height. It's not a logical solution. The measure and layout algorithm in Android is complicated. Need more investigation on this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. i will try to fix it soon

@negupta
Copy link
Contributor

negupta commented Apr 17, 2014

@bijupmb There has been no update on this PR for 4 months now. We should follow up proactively on these PR comments.

@hieupham007
Copy link
Contributor

Low priority, closing PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants