Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14753] Android: Adding borderRadius to a view in a vertical layout screws up layout

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-10-10T22:59:19.000+0000
Affected Version/sRelease 3.1.2
Fix Version/s2013 Sprint 21, 2013 Sprint 21 API, Release 3.2.0
ComponentsAndroid
Labelsmodule_views, parity, qe-manualtest, qe-testadded
ReporterTony Lukasavage
AssigneeBiju pm
Created2013-08-02T19:03:20.000+0000
Updated2014-11-20T01:35:40.000+0000

Description

problem

When a view in a vertical layout gets a borderRadius added to it, it pushes it to the end of the layout, regardless of its current position.

expected

The view should stay in its current position in the layout when it gets a borderRadius added to it.

test case

var win = Ti.UI.createWindow({
	backgroundColor: '#fff',
	modal: false,
	exitOnClose: true,
	layout: 'vertical'
});
win.addEventListener('click', function() {
	labels[1].applyProperties({
		borderRadius: 16
	});
});

var labels = [];
for (var i = 0; i < 4; i++) {
	labels.push(Ti.UI.createLabel({
		text: 'label ' + i,
		color: '#000',
		backgroundColor: '#'+Math.floor(Math.random()*16777215).toString(16),
		height: 40,
		width: 250,

		// Adding a starting borderRadius avoids the problem. It can be bigger or smaller than
		// the target borderRadius, as long as it is assigned a value.
		// borderRadius: 4
	}));
	win.add(labels[i]);
}

win.open();

Comments

  1. Biju pm 2013-09-04

    PR : - https://github.com/appcelerator/titanium_mobile/pull/4645
  2. Hieu Pham 2013-10-10

    CR + FR
  3. Paras Mishra 2013-10-21

    The view stays in its current position in the layout when it gets a borderRadius added to it. Verified fix on: Device : Google Nexus 7, Android Version: 4.3 SDK: 3.2.0.v20131018154951 CLI version : 3.2.0 OS : MAC OSX 10.8.4 Alloy : 1.2.2 Appcelerator Studio, build: 3.2.0.201310181700 XCode : 5

JSON Source