Set shadow effect for Android control

This article mainly records the shadow setting of Android controls

Create a new layer as the top layer. The principle of shadow implementation is to display a little on the top layer and expose part of the underlying layers. This requires setting the left, top, right and bottom properties of item. The setting of these parameters is similar to setting margin, so that the shadow effect can be obtained. Of course, for the effect, my parameter settings are a little exaggerated, Only the right and lower shadows are set, solid is set for filling, and stroke is set for border, color and width to see the border effect

On the top layer, the change effect of touch can still be added, that is, when the finger touches the control, the background color of the control changes

Use: Android: background = "@ drawable / your shadow XML file"

Attachment: complete shadow XML code

summary

The above is the Android control setting shadow effect introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>