0

我试图给我在 android 上的视图添加阴影,但我失败了。我需要一个简单的阴影所需结果的图像(和 iOS viewShadow 属性一样):

4

1 回答 1

3

对于 Android,您可以使用 Material Design 卡片视图,您可以在此处阅读:http: //www.appcelerator.com/blog/2015/11/titanium-5-1-0-sample-app/其中包括一个示例应用程序.

此处的文档:http: //docs.appcelerator.com/platform/latest/#! /api/Titanium.UI.Android.CardView

var card = Ti.UI.Android.createCardView({
    contentPadding: 20,
    cardCornerRadius: 10,
    cardUseCompatPadding: true
});

最重要的是,使用elevation属性:http ://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Android.CardView-property-elevation

这需要昨天发布的 TiSDK 5.1.2 或更高版本

于 2016-01-14T14:33:17.297 回答