[TIMOB-26379] Android: Nine-patch images not rendering correctly on Samsung devices
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 7.0.0 |
Fix Version/s | n/a |
Components | Android |
Labels | 9patch, Android, engSchedule |
Reporter | Teun Klijn |
Assignee | Yordan Banev |
Created | 2018-09-07T09:32:05.000+0000 |
Updated | 2019-06-07T23:49:04.000+0000 |
Description
I've created a few nine-patch images as backgrounds for buttons, but they seem to stretch in height when rendering on 2 tested Samsung devices (SM-G960F Galaxy s9, SM-G920F Galaxy s6). I've fixed the height of the button, so they shouldn't stretch.
I've tested this on a few other devices and emulators and Android versions and the rendering seems to be ok on those (HTC One M7, LG Nexus 5x)
I've also tested the images in a native Android application and then they do render correctly on *all* devices.
SM-G960F uses xxhdpi
SM-G920F uses xxxhdpi
I've attached images for xxhdpi and xxxhdpi
Example:
var win = Ti.UI.createWindow({
backgroundColor: "white"
});
var v = Ti.UI.createView({
height: Ti.UI.SIZE,
layout: 'vertical'
});
_.each(['button_background_primary.png', 'button_background_secondary.png', 'button_background_secondary_left.png'], function(image) {
v.add(Ti.UI.createView({
top: 5,
width: 150,
title: "TEST",
backgroundImage: "/images/" + image,
height: 44
}));
});
win.add(v);
win.open();
Attachments
File | Date | Size |
---|---|---|
app.zip | 2018-09-07T12:43:26.000+0000 | 8524521 |
button_background_primary.9.png | 2018-09-07T09:19:15.000+0000 | 2285 |
button_background_primary.9.png | 2018-09-07T09:19:15.000+0000 | 1229 |
button_background_secondary_left.9.png | 2018-09-07T09:19:15.000+0000 | 3728 |
button_background_secondary_left.9.png | 2018-09-07T09:19:15.000+0000 | 2770 |
button_background_secondary.9.png | 2018-09-07T09:19:15.000+0000 | 5166 |
button_background_secondary.9.png | 2018-09-07T09:19:15.000+0000 | 2787 |
expected_lg_5x.png | 2018-09-07T09:25:38.000+0000 | 38749 |
result_sm-g960f.jpg | 2018-09-07T09:31:30.000+0000 | 73368 |
Hello, Your sample code is not clear to regenerate the issue. please provide a reproducible sample project with the resources in it. Thanks.
Example with resources: [^app.zip]
I was able to reproduce the issue on Samsung S7 and S8 devices.