[TIMOB-13294] iOS: Allow user to control the clipping behavior of View
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2014-03-03T20:21:59.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | 2014 Sprint 05, 2014 Sprint 05 API, Release 3.3.0 |
| Components | iOS |
| Labels | kitchensink, qe-testadded |
| Reporter | Martin Guillon |
| Assignee | Vishal Duggal |
| Created | 2012-08-20T00:45:39.000+0000 |
| Updated | 2014-04-28T12:07:25.000+0000 |
Description
a clipChildren property would be a nice addition.
For example it would allow very easy implementation of drop shadow.
test case
var win = Ti.UI.createWindow({fullscreen: true, backgroundColor: 'white'});
// this test should test that we have a red 100x100 view in the
// center of the screen by using the size property to set it
var view = Ti.UI.createView({
width:100,
height:100,
clipChildren:false,
backgroundColor:"red"
});
var innerview = Ti.UI.createView({
left:-20,
right:-20,
backgroundColor:"green"
});
var innerview2 = Ti.UI.createView({
backgroundColor:"yellow"
});
view.add(innerview);
view.add(innerview2);
win.add(view);
var label = Ti.UI.createLabel({
text:"Should be 100x100 red square in center",
textAlign:"center",
width:"auto",
height:"auto",
top:20
});
win.add(label);
var button = Ti.UI.createButton({
title:"Change Size",
width:120,
height:40,
bottom:20
});
win.add(button);
button.addEventListener('click',function() {
view.updateLayout({
width:150,
height:150
});
label.text = "Box should now be 150x150";
});
win.open();
pull request comming
pull request https://github.com/appcelerator/titanium_mobile/pull/2781
We unfortunately need to defer this to 3.3.0 based on some high-priority customer issues.
could shadows be added to dynamically sized elements based on contents with this property? Say with a height of Ti.UI.SIZE.
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/5367 Test case added in KS BaseUI->Views->Shadows & Clipping https://github.com/appcelerator-developer-relations/KitchenSink/pull/142
any similiar property for android? How would we use this if we grabbed the CI build?
The viewShadow related properties and view clipMode property working fine. Verified on: Appc Studio: 3.3.0.201404211130 SDK build: 3.3.0.v20140422163054 alloy: 1.4.0-dev CLI: titanium-3.3.0-dev titanium-code-processor:1.1.1-beta1 Xcode: 5.1.1 Osx: 10.9.2 Device: iPhone4 (7.1)