Details
-
Type:
New Feature
-
Status: Open
-
Priority:
Low
-
Resolution: Unresolved
-
Affects Version/s: Release 3.2.3
-
Fix Version/s: None
-
Component/s: TiAPI
-
Labels:
-
Environment:
SDK 3.3.0.RC
Description
I have a Ti.UI.View which requires its width to be set to a percentage. Now I want the borderRadius of this view to be 50% of it's width so the view shows as a circle. But borderRadius does not support percentages.
I'm not sure if the borderRadius on each 2 sides of a corner could differ, but if it can't I understand this would make it difficult to support percentages.
But even in that case you could first look if either width or height is not set or set to Ti.UI.SIZE and then use the other and if both are (not) set default to the width e.g.
An example that uses a transparent square image to try to make a circle that should be 50% of the width of the window:
var win = Ti.UI.createWindow(); |
|
var circle = Ti.UI.createView({ |
width: '30%', |
backgroundColor: 'red', |
borderRadius: '50%', |
|
// so that the height will be that of the square |
height: Ti.UI.SIZE
|
});
|
|
var square = Ti.UI.createImageView({ |
width: Ti.UI.FILL,
|
image: '/images/transparent_square.png', |
|
// so that the height will equal the absolute width |
height: Ti.UI.SIZE
|
});
|
|
circle.add(square);
|
win.add(circle);
|
|
win.open();
|