Powered By Blogger

Monday, January 7, 2013

how to make a shadow around a view?

Hi,
Here, I found a something to give a shadow around a views/controls. 

Example:

    UIView *bottomDetailView = [[UIView alloc]init];
    bottomDetailView.layer.shadowColor = [UIColor blackColor].CGColor;
    bottomDetailView.layer.shadowOffset = CGSizeMake(0, 1);
    bottomDetailView.layer.shadowOpacity = 2;
    bottomDetailView.layer.shadowRadius = 8.0;
    bottomDetailView.layer.borderWidth = 1.2;
    bottomDetailView.layer.cornerRadius = 15.0;
    bottomDetailView.layer.borderColor = [[UIColor lightGrayColor] CGColor];
    [bottomDetailView setClipsToBounds:YES];


Thanks,
Nilesh M. Prajapati

No comments:

Post a Comment