Jonathan Schuder
Jonathan Schuder

Reputation: 31

How to Create Shapes with code in Android

I have an Array List and for every Item, in the Array, I want to create a shape with a Title which should be the String in the Array. The Blocks should be scroled through horizontally.

example

I dont know how to add shapes with code, do I have to create a drawable and how do I make it scrollable?

Upvotes: 0

Views: 58

Answers (1)

mmBs
mmBs

Reputation: 8559

Here you have an answer: https://stackoverflow.com/a/45953855/2065587

Also, to create a shape you can follow this thread: Simplest way to create a Shape in Android Studio

Then, you can use your shape as a background in your RecyclerView item.

Upvotes: 1

Related Questions