static class ViewHolder {
protected TextView tv0;
protected TextView tv1;
protected TextView tv2;
protected TextView tv3;
protected TextView tv4;
protected TextView tv5;
protected TextView tv6;
protected TextView tv7;
}
linearview.setTag(viewHolder);
linearView.setId(xyz);
// viewHolder.tv5 ID는 XYZ 지금 + 5
, 내가 view.getTag와 전체 클래스를 얻을 수있을 것입니다 . 무엇을 내가 원하는, 내가 단어 "TEST"
이내 임의의 함수가 2 그래서 난 등 TV2 = T, TV3 = E와 원하는 선택이 있다고 가정합니다. str.getCharAt를 사용하여 char을 얻을 수 있지만 임의의 단어에서 textViews를 가져 오는 방법.
TextView[] views = new TextView[]{tv0,tv1,tv2,tv3,etc.};
을 다음 게터 쓰기 : 클래스 내에서
안부
당신이 배열의 TextViews을 넣어하려고 했습니까? – slybloty
ehm 아니오, 아직 멀었습니다. 내가 알기로 클래스를 만들었습니다. –
@slybloty 7 개의 textView에 대해 layout.xml을 만들었습니다. 다시 text.xml을 호출하고 선형 레이아웃으로 추가했습니다. \t보기보기 = null; \t \t LayoutInflater에서 팽창기 this.getLayoutInflater =(); \t \t보기 = inflator.inflate (R.layout.words, NULL); \t \t 최종 ViewHolder viewHolder = 새로운 ViewHolder(); –