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.
我在ListView小部件中使用自定义行视图。
ListView
我getView在我的实现中有方法。
getView
我想要的是我想隐藏第二行的分隔图像我该怎么做?
如果您谈论的是调用 setDivider 或 XML 中的 android:divider 时显示的图像,我认为您不能将其隐藏在某些行上并显示在其他行上。
相反,您可以创建一个顶部或底部有边框的 PNG(可能使用 draw9patch),并在您的 ListAdapter.getView() 中将其设置为您想要的任何行的背景。在其他行上,您可以设置没有边框的背景。这将使某些行有分隔线,而另一些则没有。