Android之AttributeSet案例详解

  public interface AttributeSet {

  /**

  * Returns the number of attributes available in the set.

  *

  * @return A positive integer, or 0 if the set is empty.

  */

  public int getAttributeCount();

  /**

  * Returns the name of the specified attribute.

  *

  * @param index Index of the desired attribute, 0...count-1.

  *

  * @return A String containing the name of the attribute, or null if the

  * attribute cannot be found.

  */

  public String getAttributeName(int index);

  /**

  * Returns the value of the specified attribute as a string representation.

  *

  * @param index Index of the desired attribute, 0...count-1.

  *

  * @return A String containing the value of the attribute, or null if the

  * attribute cannot be found.

  */

  public String getAttributeValue(int index);

  /**

  * Returns the value of the specified attribute as a string representation.

  * The lookup is performed using the attribute name.

  *

  * @param namespace The namespace of the attribute to get the value from.

  * @param name The name of the attribute to get the value from.

  *

  * @return A String containing the value of the attribute, or null if the

  * attribute cannot be found.

  */

  public String getAttributeValue(String namespace, String name);