1

I'm trying to achieve the layout in the screenshot, the portion in red. I think a table layout would be appropriate but I don't mind any really, I just need to be able to achieve that pretty connecting dotted lines with a table like display. I have tried using a view with a dotted background but it does not feel right (Android Drawing Separator/Divider Line in Layout?). enter image description here

asked Oct 26, 2015 at 15:41

1 Answer 1

1

I can see two options available to you:

  1. You could try this answer (How do I make a dotted/dashed line in Android?)
  2. Create a custom View overriding the method View#onDraw(Canvas) - where you can draw whatever you want.

Taken from referenced answer:

Without java code:

drawable/dotted.xml:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
 <stroke
 android:color="#C7B299"
 android:dashWidth="10px"
 android:dashGap="10px"
 android:width="1dp"/>
</shape>

view.xml:

<ImageView
 android:layout_width="match_parent"
 android:layout_height="wrap_content"
 android:src="@drawable/dotted" />
answered Oct 26, 2015 at 15:54
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.