Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16533] Android: Button does not resize image to fit within boundaries

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.1
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterAndrew Greenstreet
AssigneeUnknown
Created2014-02-24T19:09:52.000+0000
Updated2018-02-28T20:03:59.000+0000

Description

If you create a button view with an image:
var button = Ti.UI.createButton({
  image : "/images/my-icon.png"
  width : Ti.UI.SIZE,
  height : 40
  title : "My Button"
});
if the image is taller than 40, it will be cropped, rather than scale to fit in the available space. This isn't really an issue on iOS, as there are only two image size choices, but on Android, a 2x (XHDPI) image may be chosen, even if the interface is scaled by some other method. Thus the image may be cropped.

Comments

  1. Andrew Greenstreet 2014-02-24

    Fixed @ https://github.com/appcelerator/titanium_mobile/pull/5376
  2. Ritu Agrawal 2014-02-24

    Thank you for submitting this pull request. In order for us to evaluate this pull request, we need a simple runnable test case along with the image illustrating the current issue so that we then can use the PR to verify that the issue has been fixed indeed. Again, we appreciate all your effort and hard work.
  3. Ritu Agrawal 2014-03-03

    Moving this ticket to engineering to evaluate this PR in the context of this ticket.

JSON Source