This week's book giveaway is in the Design forum.
We're giving away four copies of Experimentation for Engineers: From A/B testing to Bayesian optimization and have David Sweet on-line!
See this thread for details.
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

How to show a title to a ListView

 
Greenhorn
Posts: 14
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm trying to show a TextView in the top of a screen and, below the TextView, I want to show a ListView.

My layout is:


The only view that is being shown is the TextView. The ListView does not appear.

If I remove the TextView entry from the XML, the ListView appears.

Does anyone have an ideia of what I can do to show the TextView and the ListView?

Thanks in advance,
Best Regards
 
Ranch Hand
Posts: 99
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just add this line in LinearLayout for orientation



After adding this line ListView will show along with TextView
 
Claudinei Junior
Greenhorn
Posts: 14
Netbeans IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It worked!

Thanks a lot.

I'm just wondering why it worked - I mean: the vertical orientation is the "default" - why did I have to declare it explicity to work?

Thanks in advance,
Best Regards.
 
Anuj Prashar
Ranch Hand
Posts: 99
Android Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I'm just wondering why it worked - I mean: the vertical orientation is the "default" - why did I have to declare it explicity to work?



Default orientation is horizontal.

Check this link
 
joke time: What is brown and sticky? ... ... ... A stick! Use it to beat this tiny ad!
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic