Как этот предыдущий человек, у меня есть нежелательное совпадение между элементами GridView:
Обратите внимание на текст в каждом столбце, кроме самого правого.
В отличие от предыдущего вопроса, я не хочу постоянной высоты строки. Я хочу, чтобы высота строки изменялась до в соответствии с самым высоким содержанием в каждой строке, для эффективного использования пространства экрана.
Глядя на источник для GridView (а не авторитетная копия, но kernel.org все еще недоступна), мы можем видеть в fillDown ( ) и makeRow(), что последний вид рассматривается как "ссылочный вид": высота строки задается с высоты этого представления, а не из самой высокой. Это объясняет, почему самый правый столбец в порядке. К сожалению, GridView не очень хорошо настроен для исправления этого путем наследования. Все соответствующие поля и методы являются закрытыми.
Итак, прежде чем я возьму изрядно раздутый путь "клона и собственного", есть трюк, который мне здесь не хватает? Я мог бы использовать TableLayout, но это потребует от меня Внесите numColumns="auto_fit"
сам (так как я хочу, например, только один длинный столбец на экране телефона), и это также не будет AdaptViewView, который кажется, что это должно быть.
Изменить: на самом деле, клон и собственный не практичны. GridView зависит от недоступных частей его родительских и родственных классов и приведет к импорту не менее 6000 строк кода (AbsListView, AdapterView и т.д.).