• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Greenhorn
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?



 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic