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鏃犳晥闂

threejs娣诲姞璀︽姤鐐?/a>

vista x64 vs2010 win32娣诲姞璧勬簮 鏈兘瀹屾垚鎿嶄綔瑙e喅鍔炴硶

CentOS鍙抽敭鑿滃崟娣诲姞鏂板鏂囦欢鍛戒护

鎬庝箞瀹炵幇鍗曞嚮span鏃剁粰span娣诲姞杈规

Linux鍔ㄦ€佷负鍐呮牳娣诲姞鏂扮殑绯荤粺璋冪敤