标签: 为view分配id

1 篇文章

Android 为View分配id
简单来说,就是xml的id不允许相同,而使用代码分配的id允许相同。在查找时会使用深度优先探索,分配的id是有优先级的 资料来自:https://stackoverflow.com/questions/8460680/how-can-i-assign-an-id-to-a-view-programmatically Android id overview An Android id is an integer commonly used to identify views; this id can be assigned via XML (when possible) and via code (programmatically.) The id is most useful for getting references for XML-d…