Как получить вид с линейного размещения в Android? - PullRequest
0 голосов
/ 10 марта 2019

Я хочу получить другое представление от Linearlayout, но оно всегда дает мне один из них.Вот мой код:

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:

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}
...