0

我有一个简单的问题,你可以在标题中看到。是否有机会在 gridview 中找到知道该视图文本的元素?

4

1 回答 1

0

There is a method in the View Class called:

public void findViewsWithText (ArrayList<View> outViews, CharSequence searched, int flags)

See Docs Here...

this will do exactly what you want, however, it will not be as "tight" as you would like because there might be several views with the same text this is why it returns an ArrayList of views that match the required text.

I suggest using

public final View findViewWithTag (Object tag)

See Docs Here...

And use an Int as the tag that represents the day number.

于 2013-09-25T07:36:36.253 回答