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

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
if (hasChildView) {
content.getLayoutParams().height = h;
Expand Down