Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Android graphics: Draw rectangle whose dimesnions can be programmatically changed

Ranch Hand
Posts: 52
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
down vote favorite


I have a layout- an ImageView with TextViews on its top and bottom. Now I want to add a rectangular vertical bar (to the left or right of this setup) which changes its height (and also colour) from bottom to top. At the moment, I have used a TextView which increases height from top to bottom (I couldn't make it the other way round).

I don't know how to use graphics to draw a rectangle and then add that rectangle to the above xml layout (with an ImageView and 2 TextViews).

Please suggest a way to do this-either to increase the height of TextView from bottom to top or a different better way than what I am following.

Thank you for your time.


please buy this thing and then I get a fat cut of the action:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic