view娣诲姞闃村奖鏃犳晥
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了view娣诲姞闃村奖鏃犳晥相关的知识,希望对你有一定的参考价值。
鏍囩锛?/p>
闇€姹傦細闇€瑕佺粰cell閲岀殑imageview娣诲姞闃村奖
闂锛氭寜鐓ф爣鍑嗙殑浠g爜娣诲姞闃村奖锛岀劧骞跺嵉锛氫唬鐮佸涓嬶細
imageview.layer.shadowColor = [[UIColor blackColor] CGColor]; imageview.layer.shadowOffset = CGSizeMake(4.0f, 4.0f); imageview.layer.shadowRadius = 4.0; imageview.layer.shadowOpacity = 0.5;
鍚庤胺姝岃瑕佸姞涓€鍙ワ細
imageview.layer.masksToBounds = NO;锛屽洜涓洪槾褰辨槸鍦╥magview鐨刲ayer澶栭潰鐢荤殑
杩欐牱闃村奖鍑烘潵浜嗭紝鐒惰€岋紝鐢变簬鍏佽瀛愬厓绱犺秴鍑虹埗鍏冪礌锛屾墍浠ュ浘鐗囩殑澶у皬灏变笉涓€鏍蜂簡
鍥犳姝灉浠佹彁鍑轰簡涓€涓姙娉曪紝鍒涘缓涓ゅ眰view锛屽唴灞倂iew鏄痠mageview锛屼笉鍏佽瓒呭嚭杈圭晫锛屽灞倂iew鏄痵hadowview锛宺ef:
http://www.innofied.com/implementing-shadow-ios/(杩欎釜鏄负浜嗚В鍐冲渾瑙抳iew锛嬮槾褰辩殑闂)
浠g爜锛?/p>
CALayer *sublayer = [[CALayer layer]initWithLayer:self.imageView.layer]; UIView * shadow = [[UIView alloc] initWithFrame:self.imageView .frame]; shadow.userInteractionEnabled = NO; // Modify this if needed shadow.layer.shadowColor = [[UIColor blackColor] CGColor]; shadow.layer.shadowOffset = CGSizeMake(4.0f, 4.0f); shadow.layer.shadowRadius = 4.0; shadow.layer.masksToBounds = NO; //鍏抽敭 shadow.clipsToBounds = NO; shadow.layer.shadowOpacity = 0.5; [ self.imageView.superview insertSubview:shadow belowSubview: self.imageView]; [shadow addSubview:self.imageView];
以上是关于view娣诲姞闃村奖鏃犳晥的主要内容,如果未能解决你的问题,请参考以下文章
Android EditText maxLines鏃犳晥闂