iOS给image/view增加阴影

iOS给image/view增加阴影,第1张

这是从xcode里面摘取的内容,苹果的官方文档

/** Shadow properties. **/

/* The color of the shadow. Defaults to opaque black. Colors created

* from patterns are currently NOT supported. Animatable. */

@property(nullable) CGColorRef shadowColor

/* The opacity of the shadow. Defaults to 0. Specifying a value outside the

* [0,1] range will give undefined results. Animatable. */

@property float shadowOpacity

/* The shadow offset. Defaults to (0, -3). Animatable. */

@property CGSize shadowOffset

/* The blur radius used to create the shadow. Defaults to 3. Animatable. */

@property CGFloat shadowRadius

/* When non-null this path defines the outline used to construct the

其实就是三个属性

后面这个是做的效果图

form http://blog.csdn.net/rhljiayou/article/details/10178723

楼上看清楚,天极那个不是用flash而是用js做的。

1.保存js代码

2.拷贝以下代码到你的网页,并把图片和链接改为你自己的:

<div class="box-1">

<div class="box-1-l">

<div class="clear1"></div>

<div class="box100">

<div class="box1-l-left">

<SCRIPT language=javascript>

var widths=282

var heights=164

var counts=6

img1=new Image ()img1.src=''

img2=new Image ()img2.src=''

img3=new Image ()img3.src=''

img4=new Image ()img4.src=''

img5=new Image ()img5.src=''

img6=new Image ()img6.src=''

url1=new Image ()url1.src=''

url2=new Image ()url2.src=''

url3=new Image ()url3.src=''

url4=new Image ()url4.src=''

url5=new Image ()url5.src=''

url6=new Image ()url6.src=''

</SCRIPT>

<SCRIPT src="softindexfocuspic.js"></SCRIPT></div><!--注意此js和页面的路径关系问题-->

3.你所说的什么有阴影只是一张背景图片而已。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/bake/11303479.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存