실제로 꽤 간단한 것을 시도했지만, 안드로이드와 자바는 내 인생을 쉽지 않게 만들고 있습니다. 아이디어는 테이블 레이아웃에서 지정된 자식으로 스크롤하는 것입니다.tablelayout getchildat 그 자식에게 스크롤
내가 같은 테이블 레이아웃에 항목을 추가 LayoutInflater에서 사용하고 다음
TableLayout tl = (TableLayout)findViewById(R.id.myTableLayout3);
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View itemView = inflater.inflate(R.layout.element_news, null);
TextView firstname = (TextView) itemView.findViewById(R.id.tvname);
firstname.setText(FN + " " + iLN);
TextView date = (TextView) itemView.findViewById(R.id.tvdate);
date.setText(newPD);
TextView post = (TextView) itemView.findViewById(R.id.tvpost);
post.setText(c.getString(iP));
post.setFocusable(true);
tl.addView(itemView, new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
나는 TableLayout을위한 getChildAt()를 사용하려고하고 내가 사용하지만 때, 아이를 어떻게해야합니까 모든 것을 "0"으로 돌려주는 아이.
예제 코드 :이 반환하는 텍스트 뷰 신장
LinearLayout row = (LinearLayout) tl.getChildAt(1);
TextView tv = (TextView) row.getChildAt(1);
tv.requestFocus();
Log.w("news", Integer.toString(tv.getHeight()));
"0"에 있는데도 그것은 여러 라인 중 하나가 작동하지 않는 requestFocus를()를 포함한다.
그래서 어떻게 테이블 레이아웃에서 하위로 스크롤 할 수 있습니까?
미리 도움을 청하십시오.
감사합니다. – Max
22 시간이 지나면 평점 50 점을 부여합니다. – Max