In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to achieve Android shadow rendering effect through elevation and Z value" related knowledge, editor through the actual case to show you the operation process, the method of operation is simple and fast, practical, I hope that this "how to achieve Android shadow rendering effect through elevation and Z value" article can help you solve the problem.
With the release of the Lollipop system, Android introduced the concept of Z axis for the layout system. This allows us to lay out views in three-dimensional space. As shown in the following figure, elevation is similar to the coordinates assigned to a layout view: the view can dynamically move away from its original coordinates, but its original location is unchanged.
You can use the View.setElevation (float) method or set the lift value in the layout XML file, as shown in the following code.
Set the lift value in the layout file
Because the elevation value is to be used as the Z base value, it is best to set the value of the XML property. Moreover, this approach is more flexible than the setElevation (float) method, and previous versions of Lollipop ignored the android:elevation attribute by default, so there is no need to worry about the more intractable compatibility issues.
To modify the elevation of the View view, we can use the translationZ and Z properties. As shown in the following figure, the Z value is always equal to elevation plus translationZ. If you give Z a value, the translationZ value is automatically calculated.
This is the end of the content on "how to achieve Android shadow rendering effect through elevation and Z value". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.