Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use layer-list in Android

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces how to use layer-list in Android, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

Using layer-list, multiple drawable can be displayed on top of each other in order. By default, all drawable in item will automatically scale according to the size of the view attached to it.

The item in layer-list is superimposed from the bottom to the top in order, that is, the first defined item is at the bottom, and the next one is stacked on top.

Examples

Overall Arrangement

The red item is finally defined at the top, in the middle of the green item, and at the bottom of the blue color.

The android:bottom= "50dp" android:top= "50dp" android:left= "50dp" android:right= "50dp" attribute android:top= "50dp" is set here; it means that the upper side of the item shrinks 50 dpandroid bottoms inwards with the upper boundary of ImageView, which means that the lower side of the item shrinks 50 dpandroidandroid:left= inward with the lower boundary of ImageView; indicates that the item shrinks 50 dpandroidright= "50dp" with the left edge of ImageView; indicates that the right side of the item shrinks inward with the right boundary of ImageView.

Android:bottom= "25dp" android:top= "25dp" android:left= "25dp" android:right= "25dp" is similar

Layer-list implements a three-sided border for a specified view.

Overall Arrangement

Code:

Thank you for reading this article carefully. I hope the article "how to use layer-list in Android" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report