roundedcorners-dropshadow

How to add an outer shadow for a rounded-corners drawable?

牧云@^-^@ 提交于 2019-12-11 01:22:39
问题 I'm using this RoundedCorners library (based on Romain Guy's post) which allows to set both outline border and a rounded rectangular image to an imageView . I need to add an outer shadow (meaning it's outside of the image being shown) to the image that is shown (say ,to direction south-east) . I've decided that since the border is the larger part of what is shown, I would add the shadow to it instead of to the image, using the next extra code in RoundedDrawable : mBorderPaint.setShadowLayer

Drop shadow in ios

落花浮王杯 提交于 2019-12-02 23:17:42
问题 How to drop an object shadow in iOS? My object is UIImageView and i want to drop an elliptical shadow.Please refer image for reference. 回答1: Better you use another image for showing shadow. Use blur image or change alpha of the imageview. Or if you want to do it programmatically, try it: Obj c: //create elliptical shadow for image through UIBezierPath CGRect ovalRect = CGRectMake(0.0f, _imageView.frame.size.height + 10, _imageView.frame.size.width, 15); UIBezierPath *path = [UIBezierPath

Drop shadow in ios

时间秒杀一切 提交于 2019-12-02 10:40:33
How to drop an object shadow in iOS? My object is UIImageView and i want to drop an elliptical shadow.Please refer image for reference. Jamshed Alam Better you use another image for showing shadow. Use blur image or change alpha of the imageview. Or if you want to do it programmatically, try it: Obj c: //create elliptical shadow for image through UIBezierPath CGRect ovalRect = CGRectMake(0.0f, _imageView.frame.size.height + 10, _imageView.frame.size.width, 15); UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:ovalRect]; //applying shadow to path _imageView.layer.shadowColor =

Can't set cornerRadius AND shadow on layer that has an image view stretched to its bounds?

孤人 提交于 2019-11-30 08:27:41
This is stumping me. I have a UIView (call it "parent"). The bottommost subview of that view is a UIImageView (call it "child"), whose frame occupies the entirety of the "parent" bounds. I want to round the corners on the "parent" view, and set a drop shadow. I do this on the CALayer of "parent" as usual: [[parent layer] setShadowOffset:CGSizeMake(5, 5)]; [[parent layer] setShadowRadius:6]; [[parent layer] setShadowOpacity:0.4]; [[parent layer] setCornerRadius:6]; This shows the shadow correctly, but does not round the corners. Here's the kicker: If I remove the "child" image view, or shrink

Can't set cornerRadius AND shadow on layer that has an image view stretched to its bounds?

孤街醉人 提交于 2019-11-29 11:20:10
问题 This is stumping me. I have a UIView (call it "parent"). The bottommost subview of that view is a UIImageView (call it "child"), whose frame occupies the entirety of the "parent" bounds. I want to round the corners on the "parent" view, and set a drop shadow. I do this on the CALayer of "parent" as usual: [[parent layer] setShadowOffset:CGSizeMake(5, 5)]; [[parent layer] setShadowRadius:6]; [[parent layer] setShadowOpacity:0.4]; [[parent layer] setCornerRadius:6]; This shows the shadow

How to show shadow around the linearlayout in android?

青春壹個敷衍的年華 提交于 2019-11-26 19:28:32
How can i show shadow for my linear layout. I want white colored rounded background with shadow around the linearlayout. I have done this so far. Please help me. Thanks in advance. <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="10dp" android:background="@xml/rounded_rect_shape" android:orientation="vertical" android:padding="10dp"> <-- My buttons, textviews, Imageviews go here --> </LinearLayout> And rounded_rect_shape.xml under xml directory <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk

How to show shadow around the linearlayout in android?

我是研究僧i 提交于 2019-11-26 06:59:51
问题 How can i show shadow for my linear layout. I want white colored rounded background with shadow around the linearlayout. I have done this so far. Please help me. Thanks in advance. <LinearLayout android:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\" android:layout_margin=\"10dp\" android:background=\"@xml/rounded_rect_shape\" android:orientation=\"vertical\" android:padding=\"10dp\"> <-- My buttons, textviews, Imageviews go here --> </LinearLayout> And rounded_rect_shape