[TIMOB-28335] iOS: Button Image renders blue shape, not actual image
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 9.2.2, Release 9.3.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Rene Pot |
Assignee | Vijay Singh |
Created | 2021-02-04T11:01:03.000+0000 |
Updated | 2021-02-17T21:08:06.000+0000 |
Description
On iOS, when setting the image property on a
Ti.UI.Button
the image itself is not actually displayed, but instead, a blue shape is rendered instead (see attachment).
The blue shape is shaped the way the image is, but there is no way to actually get the image to display properly.
*Expected result*
The image should display as expected
*Example code*
<Alloy>
<Window>
<View id="myIcon">
<Label>Oo</Label>
</View>
<Button id="Awesome" />
</Window>
</Alloy>
$.getView().open();
setTimeout(() => {
let blob = $.myIcon.toImage();
$.Awesome.image = blob;
}, 1000);
"Window": {
backgroundColor: "#fff"
}
"#Awesome": {
title: "Awesome",
height: 50,
width: 200,
borderWidth: 1,
borderRadius: 10,
borderColor: "#333",
color: "#333"
}
"#myIcon": {
height: 30,
width: 30,
backgroundColor: "green",
top: 100,
borderRadius: 6
}
"Label": {
font: {
fontSize: 12
},
top: 3
}
Attachments
File | Date | Size |
---|---|---|
Simulator Screen Shot - iPhone 11 - 2021-02-04 at 10.56.42.png | 2021-02-04T11:00:06.000+0000 | 45359 |
TestImageOnButton.zip | 2021-02-17T21:04:35.000+0000 | 41511 |
[~topener] Can you confirm if the issue is with toImage() function or while assigning image to Button?
[~vijaysingh] the problem is with any image applied to the button, I just used toImage() to be able to reproduce the problem without having to supply an image in the sample.
In native implementation also it is behaving in same way. It is showing blue image. See [^TestImageOnButton.zip] . It looks like apple bug. May be you want to use property [backgroundImage](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Button-property-backgroundImage).