列表视图中一个文本视图和一个图像视图,怎么可能?
我想为列表视图编写代码。在列表视图中,列表视图的一行中将有一个文本视图和一个图像视图。怎么可能呢。我在 TabHost 控件中使用该代码。
I want to make code for a listview. In listview there will be a textview and an imageview both in one line of the listview. How is it possible. I am using that code in my TabHost control.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要编写自己的列表视图项布局,其中包括文本视图和图像视图。这是关于编写自定义列表视图的好指南。
You need to write your own list view item layout, which includes a text view and an image view. Here's a good guide on writing a custom list view.
创建特定于每行的布局。在您的情况下,它将包含包装在相对布局或线性布局中的文本视图和图像视图。然后为每行膨胀该视图
Create a layout that is specific to each line. In your case, it will contain the textview and imageview wrapped in either a relative or linearlayout. Then just inflate that view for each line