Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1973] Android: borderRadius not clipping controls' content area

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-04-08T20:11:22.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterAdnan Travar
AssigneeMauro Parra-Miranda
Created2012-12-20T09:40:15.000+0000
Updated2016-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

FileDateSize
device-2012-12-20-100155.png2012-12-20T09:40:15.000+000040362
device-2012-12-20-100207.png2012-12-20T09:40:15.000+000041920

Comments

  1. Adnan Travar 2012-12-20

    My bad, this should have been put in Titanium Mobile section :/
  2. Federico Casali 2012-12-20

    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.
  3. Adnan Travar 2012-12-20

    @Federico I'm using HTC One X with 4.1.2 JB (CM10 to be exact) on it.
  4. Adnan Travar 2012-12-21

    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.
  5. Adnan Travar 2013-01-02

    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.
  6. Carter Lathrop 2013-04-08

  7. Mauro Parra-Miranda 2013-11-24

    DUP issue.

JSON Source