꿈소년의 개발 이야기

[View] public class View's Tag 본문

Android Development

[View] public class View's Tag

꿈소년 2011. 4. 25. 19:38
반응형
Tags
Unlike IDs, tags are not used to identify views. Tags are essentially an extra piece of information that can be associated with a view. They are most often used as a convenience to store data related to views in the views themselves rather than by putting them in a separate structure.
          
android:tag
Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with  View.findViewWithTag().

String VIEW_LOG_TAG
The logging tag used by this class with android.util.Log.

final View findViewWithTag(Object tag)
Look for a child view with the given tag.

Object  getTag(int key)
Returns the tag associated with this view and the specified key.

Object  getTag()
Returns this view's tag.


void     setTag(int key, Object tag)
Sets a tag associated with this view and a key.

void     setTag(Object tag)
Sets the tag associated with this view.