• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Himai Minh
  • Carey Brown
  • Frits Walraven

how to set gravity to center of textview in Android gridview?

Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a gridview of textview and checkbox in an android project. When I add setGravity(Gravity.Center) in adapter class, the result prints the first data in second row. It should output in the first row. The row number is exactly the same as rows of data in txt file. Below is my code. When I call onItemClick in Activity class with getItemAtPosition method, the item on clicked items are correct. If you see the picture below, even though the first row of textviews show nothing getItemAtPosition method does read my first row of my txt file(which is also the next row in the picture below).
Could someone tells me why this is happening and how to solve this issue?

Ruth Stout was famous for gardening naked. Just like this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic