Skip to main content

Set shadow for UIView on 4 side (top,right,bottom and left)

UIView *rateVW=[[UIView alloc] initWithFrame:CGRectMake(+25, [[UIScreen mainScreen] bounds].size.height/4-30, [[UIScreen mainScreen] bounds].size.width-50,  [[UIScreen mainScreen] bounds].size.height/2)];
    rateVW.layer.cornerRadius=5;
    rateVW.backgroundColor=[UIColor whiteColor];
    
    rateVW.layer.shadowColor = [UIColor blackColor].CGColor;
    rateVW.layer.shadowOpacity = 0.7;
    rateVW.layer.shadowOffset = CGSizeZero;
    rateVW.layer.shadowRadius = 4;
    rateVW.layer.shadowPath = [UIBezierPath bezierPathWithRect:rateVW.bounds].CGPath;

    [backView2 addSubview:rateVW];

Enjoy Coding...!

Comments

Popular posts from this blog

post method using alamofire in swift 3

  func addSubscriptionApi(_completeUrl: String ) {         //HUD         Alamofire.request(_completeUrl, method:.post, parameters: nil , encoding: JSONEncoding. default , headers: nil ).responseJSON { response in             switch (response.result) {             case .success( _ ):                 if let data = response.result.value as ? NSDictionary                 {                     print(response.result.value as Any)                     print(data)                      print("SUCCESS")                  }                 break  ...

Set Placeholder in UiTextView in swift 3

//In viewdidLoad add this                DiscriptionTV . text = "Discription"         DiscriptionTV . textColor = UIColor . lightGray         DiscriptionTV . delegate = self          DiscriptionTV . layer . borderColor = UIColor . lightGray . cgColor ; then   //Mark:- textView Delegates          func textViewDidBeginEditing( _ textView: UITextView ) {         if DiscriptionTV . textColor == UIColor . lightGray {             DiscriptionTV . text = nil             DiscriptionTV . textColor = UIColor . white             DiscriptionLab . isHidden = false         }     }          func textViewDidEndEditing( _ textView: UITextView ) { ...