Titanium JIRA Archive
Appcelerator Community (AC)

[AC-869] Android borderRadius property not working with using view layout = "horizontal"

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2014-09-19T07:32:41.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
LabelsTCSupportTriage, android, borderRadius, listView
ReporterKerberos
AssigneeMauro Parra-Miranda
Created2014-08-29T08:59:17.000+0000
Updated2016-03-08T07:37:10.000+0000

Description

My codes as below. When i debug my codes on iOS everything is OK. Child ıtems shows left to right. But on Android, child items not looking right. I have worked hard to find issue source. Finally when I modify borderRadius property to 0 (zero) everything is OK like iOS.
var $ListViewLinksTemplate = {
	childTemplates : [{
		type : 'Ti.UI.View',
		properties : {
			top : 9,
			width : Ti.UI.SIZE,
			height : Ti.UI.SIZE,
			backgroundColor : "transparent",
			layout : "horizontal",
		},
		childTemplates : [{
			type : 'Ti.UI.View',
			properties : {
				top : 0,
				left : 0,
				width : 30,
				height : 30,
				backgroundColor : Alloy.Globals.Color2,
				borderRadius: 6
			},
			childTemplates : [{
				type : 'Ti.UI.ImageView',
				bindId : '_ImageViewIcon',
				properties : {
					width : 26,
					height : 26,
				}
			}]
		}, {
			type : 'Ti.UI.View',
			bindId : '_ViewForLabels',
			properties : {
				layout : "vertical",
				left : 5,
				width : 100,
				height : Ti.UI.SIZE
			},
			childTemplates : [{
				type : 'Ti.UI.Label',
				bindId : '_LabelHeader',
				properties : {
					width : "100%",
					height : Ti.UI.SIZE,
					textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
					color : Alloy.Globals.Color5,
					text : "",
					font : {
						fontSize : 16,
						fontFamily : Alloy.Globals.CustomFont
					}
				}
			}, {
				type : 'Ti.UI.Label',
				bindId : '_LabelExplain',
				properties : {
					bottom : 3,
					width : "100%",
					height : Ti.UI.SIZE,
					textAlign : Ti.UI.TEXT_ALIGNMENT_LEFT,
					color : Alloy.Globals.Color10,
					text : "",
					font : {
						fontSize : 12,
						fontFamily : Alloy.Globals.CustomFont
					}
				}
			}],
		}, {
			type : 'Ti.UI.ImageView',
			properties : {
				image : "images/icon-right-arrow.png",
				width : 16,
				height : 16
			}
		}],

	}],
	properties : {
		accessoryType : Ti.UI.LIST_ACCESSORY_TYPE_NONE,
		height : Ti.UI.SIZE,
		backgroundColor : "transparent",
		selectedBackgroundColor : "transparent",
		selectionStyle : Alloy.Globals.PlatformName == 'iPhone OS' ? Ti.UI.iPhone.ListViewCellSelectionStyle.NONE : "transparent",
	}
};

Attachments

FileDateSize
Snap3.png2014-08-29T08:59:17.000+0000144664

Comments

  1. Mostafizur Rahman 2014-09-01

    Hello, We have tested this issue with our sample code. Its not a bug. It works as we expect. If *borderRadius* is specified as an integer then we need to set
    <property name="ti.ui.defaultunit" type="string">dp</property>
    in the TiApp.xml *TESTING ENVIRONMENT:* Titanium SDK: 3.3.0.GA and 3.2.3.GA Titanium CLI: 3.3.0 OS X Version: 10.9.3 Android API Level: 17 and 19 *STEPS TO REPRODUCE:* a) Create a simple project. b) Update this code in app.js c) Run this with testing environment *TESTING CODE:*
    var win = Ti.UI.createWindow({
           backgroundColor : '#000'
       });
       var v = Ti.UI.createView({
           width : 100,
           height : 100,
           borderRadius : 25,
           borderWidth : 3,
           borderColor : 'green'
       }); 
       win.add(v);
       win.open();
    *In Alloy Project* index.xml
    <Alloy>
       	<Window layout="vertical">
       		<View  width = '100'height = '100'borderRadius = '25'borderWidth = '3'borderColor ='green'></View>
       	</Window>
       </Alloy>
    index.js
    $.index.open();
    *TESTING RESULT:* Its working perfectly.

JSON Source