In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to use Android to achieve the triangle border effect on one side of the picture, Xiaobian feels quite practical, so share it with you as a reference, I hope you can gain something after reading this article.
In the real APP, we will also add a SrcollView control, so that you can continuously browse up and down. We are here mainly to let everyone understand how this view is implemented, not to demonstrate the SrcollView control under the practice, directly in the linear layout to do a simple explanation. Since there are four diagrams in the linear layout, we can write a custom view for each imageview separately, and then combine them in the syntax, which can improve the efficiency of UI development, collaborative work and development. First we implement the triangle view in the upper left corner and upper right corner.
Add the following code to the build.gradle file and import the maven library:
allprojects { repositories { ... maven { url "https://jitpack.io" } }}
Then add the library to another build.gradle file:
dependencies { implementation 'com.github.shts:TriangleLabelView:1.1.2' }
We've done our preliminary work, and now we're officially writing each of our triangle border views, starting with the first view in the upper left corner.
I. card_left_top.xml:
After writing, it will be displayed in preview as follows:
Below is the view in the upper right corner
II. card_right_top.xml:
III. card_right_buttom.xml:
IV. card_left_buttom.xml:
Finally, let's integrate it and it's OK! The code for the integrated main activity is:
V. activity_main.xml:
About "how to use Android to achieve the triangle border effect on one side of the picture" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it for more people to see.
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.