jQuery in Action, 2nd edition*
The moose likes Android and the fly likes Android: Add custom widget or view (ex. vertical bar) which changes height programmatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Android
Bookmark "Android: Add custom widget or view (ex. vertical bar) which changes height programmatically" Watch "Android: Add custom widget or view (ex. vertical bar) which changes height programmatically" New topic
Author

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

Madhu Nandan
Ranch Hand

Joined: Dec 16, 2010
Posts: 52

Hello,

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.

Cheers,
Madhu

main.xml



Main activity:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Android: Add custom widget or view (ex. vertical bar) which changes height programmatically