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
[TIMOB-7794] set view as outerview #5048
Conversation
@@ -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())); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@bijupmb There has been no update on this PR for 4 months now. We should follow up proactively on these PR comments. |
Low priority, closing PR |
https://jira.appcelerator.org/browse/TIMOB-7794