1
도서 리더 어플리케이션을 개발 중입니다. LinearLayout 있습니다.Textview를 식별하는 방법은 화면 하단에 도달 했습니까?
<LinearLayout
android:id="@+id/llReader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:orientation="vertical" >
</LinearLayout>
줄 단위로 내부 저장소에서 html 파일을 가져오고 있습니다. 한 줄에 하나의 텍스트보기를 할당하고이를 LinearLayout에 넣고 있습니다.
private void readFile(LinearLayout ll) throws IOException {
fileName = myDatabase.getBookById(book_id) + ".html";
FileInputStream fis = openFileInput(fileName);
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String line = "";
while (null != (line = br.readLine())) {
TextView tv = new TextView(this);
tv.setTextSize(24);
tv.setText(Html.fromHtml(line));
ll.addView(tv);
}
br.close();
}
어떻게 TextViews가 화면 하단에 도달했는지 식별하는 방법은 무엇입니까?
들으하지만 내부에 넣을 때 잠시 'Log.d ("AkitaLog", "sumHeight :"+ sumHeigth + "; parentHeight :"+ parentHeight);' ** 03-25 20 : 51 : 29.800 : D/AkitaLog (2825) : sumHeight : 0; parentHeight : 0 ** – user3388473