我想从Linearlayout获得不同的视图,但是它总是让我成为其中之一。 这是mycode:
int count = LinearLayoutItemHolder.getChildCount() ;
for(int i = 0 ; i <count ; i++){
Customview cs = LinearItemHolder.getChildAt(i) ;
Log.d(TAG,"value of cs " + cs) ;
Log.d(TAG,"value : " + cs.txtText.getText() ) ;
}
我的LinearLayoutHolder有3个孩子,但它总是让我回到他们的最后一个孩子。
cs id的值:
run: com.example.mine.happyp.View.CustomView{2a6e0e3 V.E...... ......I. 0,0-0,0}
run: com.example.mine.happyp.View.CustomView{c251ae0 V.E...... ......I. 0,0-0,0}
run: com.example.mine.happyp.View.CustomView{33ce199 V.E...... ......I. 0,0-0,0}
run: 3
run: com.example.mine.happyp.View.CustomView{2fedc5e V.E...... ........ 0,0-720,660}
run: com.example.mine.happyp.View.CustomView{c5ca83f V.E...... ........ 0,660-720,1320}
run: com.example.mine.happyp.View.CustomView{e71050c V.E...... ........ 0,1320-720,1980}