一面
- 自我介绍
- 注意点:说有亮点的、跳槽原因,从各个点尽力彰显自己优势、技术特长
- 手写代码:计算View树上所有view的数量,参数ViewGroup
- 本质上就是数据结构多叉树递归层序遍历+Android View基本api调用
public int getCount(ViewGroup viewGroup){
int count=viewGroup.getChildCount();
//循环获取子View
for(int i=0;i<count;i++){
View child=viewGroup.getChildAt(i);
if(child instanceof ViewGroup){
//如果子View是ViewGroup,则用递归获取子View数量
int childCount = getCount((ViewGroup)child);
count+=childCount;
}else {
count++;
}
}
return count;
}
- Android相关
线程的阻塞状态&#x