[AC-1973] Android: borderRadius not clipping controls' content area
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2013-04-08T20:11:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Adnan Travar |
Assignee | Mauro Parra-Miranda |
Created | 2012-12-20T09:40:15.000+0000 |
Updated | 2016-03-08T07:40:54.000+0000 |
Description
As you can see from first screenshot, the content area is not being clipped by border if it has borderRadius property set unless i set borderRadius on the controls' parent too.
First screenshot shows label with borderRadius set to 50, and parent view with borderRadius not set (or set to 0)
The second screenshot shows label with borderRadius set to 50, and parent view with borderRadius set to 1
This happens on my test device, but works as intended on Android emulator.
It also works as intended on Ti SDK 2.1.2
Here is the code for a view containing the above:
//FirstView Component Constructor
function FirstView() {
//create object instance, a parasitic subclass of Observable
var self = Ti.UI.createView({
backgroundColor : "gray",
//borderRadius:1, //Uncomment/comment this line to see the effects of borderRadius of label control bellow
borderWidth : 2
});
//label using localization-ready strings from <app dir>/i18n/en/strings.xml
var label = Ti.UI.createLabel({
color : '#000000',
text : String.format(L('welcome'), 'Titanium'),
height : 'auto',
width : 'auto',
borderRadius : 50,
backgroundColor : "orange",
borderWidth : 5,
borderColor : "white",
font : {
fontSize : "40dp"
}
});
self.add(label);
//Add behavior for UI
label.addEventListener('click', function(e) {
alert(e.source.text);
});
return self;
}
module.exports = FirstView;
Attachments
File | Date | Size |
---|---|---|
device-2012-12-20-100155.png | 2012-12-20T09:40:15.000+0000 | 40362 |
device-2012-12-20-100207.png | 2012-12-20T09:40:15.000+0000 | 41920 |
My bad, this should have been put in Titanium Mobile section :/
Adnan - on which device are you experiencing this issue? Might be device dependent. On Galaxy Nexus 4.2.1 I do see it correctly displayed.
@Federico I'm using HTC One X with 4.1.2 JB (CM10 to be exact) on it.
Just tried this on Samsung Galaxy S (Android 2.3 i believe) and on emulator with Android 4.1, and no problems in both cases :/ I'm not sure if it's a device or OS dependent problem though.
Apparently there is a problem with hardware acceleration, which, if turned ON, causes this problem and if turned OFF, it causes some drop in performance while scrolling a view with multiple controls that have rounded corners.
DUP issue.