Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26379] Android: Nine-patch images not rendering correctly on Samsung devices

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 7.0.0
Fix Version/sn/a
ComponentsAndroid
Labels9patch, Android, engSchedule
ReporterTeun Klijn
AssigneeYordan Banev
Created2018-09-07T09:32:05.000+0000
Updated2019-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

FileDateSize
app.zip2018-09-07T12:43:26.000+00008524521
button_background_primary.9.png2018-09-07T09:19:15.000+00002285
button_background_primary.9.png2018-09-07T09:19:15.000+00001229
button_background_secondary_left.9.png2018-09-07T09:19:15.000+00003728
button_background_secondary_left.9.png2018-09-07T09:19:15.000+00002770
button_background_secondary.9.png2018-09-07T09:19:15.000+00005166
button_background_secondary.9.png2018-09-07T09:19:15.000+00002787
expected_lg_5x.png2018-09-07T09:25:38.000+000038749
result_sm-g960f.jpg2018-09-07T09:31:30.000+000073368

Comments

  1. Sharif AbuDarda 2018-09-07

    Hello, Your sample code is not clear to regenerate the issue. please provide a reproducible sample project with the resources in it. Thanks.
  2. Teun Klijn 2018-09-07

    Example with resources: [^app.zip]
  3. Yordan Banev 2018-09-11

    I was able to reproduce the issue on Samsung S7 and S8 devices.

JSON Source