简体   繁体   中英

Android layout vs. custom view

I want to generate the following for my Android application.

在此处输入图片说明

I tried to achieve this using RelativeLayout and some drawables (empty circle, filled circle, dotted line) I created using XML , but I am not even close to it. Is it the right way to generate such views with layouts. If so, is RelativeLayout is the way to go? Or should I create a custom view for that?

why are there 4 dots between the last item and the one before it, while the other have 3 dots?

anyway, i think you can achieve those results by having a listView with custom items.

each item would be shown as a relativeLayout with 2 imageViews (one below the other) and a textView on the right of the upper one.

the upper imageView would have the large dot (filled or not), with optional dots above it, and the imageView below would stretch its size according to the textView (align to its bottom plus add some more for extra small-dots) and have tiled dots as its background.

another approach would be to have a listView of textViews and an imageView on its left, and you draw the circles according to what the listView is currently showing (even while scrolling). it's much harder, but might be more precise.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM