Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Frits Walraven
  • Himai Minh

Android: Add custom widget or view (ex. vertical bar) which changes height programmatically

Ranch Hand
Posts: 52
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have modified the main.xml to include an ImageView and two text views-one each on top and bottom of the ImageView. I set the image and the text to be displayed. Now I want to add another vertical bar to the left or right of this setup (one image view and two text views) and I want to programmatically increase or decrease the height of this vertical bar. I tried using a TextView and set it's height with TextView.setHeight(int variable) but this does not work and I get an error.

Please tell me if my approach is right (I guess it is not) or kindly inform me of any better way of doing this.



Main activity:

Is that a spider in your hair? Here, threaten it with this tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic