Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在设计和实施布局时遇到问题,例如:
谁能指导我如何每行添加两个项目?
我尝试过gridview,但无法实现这个完美的设计。
创建一个列表Pair<YourObjectType, YourObjectType>并在您的适配器中根据 pair.first、pair.second 对象设置您的视图
Pair<YourObjectType, YourObjectType>
实际上,看起来每行有 4 个项目:2ImageView和 2 TextView。要实现这一点,您需要使用自定义ArrayAdapter查看我昨天给出的有关如何创建的答案:
ImageView
TextView
ArrayAdapter
如何根据从 web 服务收到的结果构建 ArrayAdapter?