Hello. I read the methods, re-read the example in the book, flipped through the forums, I didn’t add it myself. How to align the content (line of text) in each cell of the GridView widget in the center? Does it have to be a combination of certain parameters in the .xml markup file of the launched Grid Activity or is it done programmatically in a class? Is it possible at all? The need for such a task is fully justified.
3 answers
Try to play with android: gravity . This property, which determines the location of the object inside each cell along the vertical and horizontal axis. For example:
<GridView xmlns:android="http://schemas.android.com/apk/res/android" ... android:gravity="center" />
|
Watched here ? May I help.
|
Alternatively, you can use the same indentation with the help of android: layout_margin in the markup file
|