이것은 바보 같은 질문이지만 나는 같은 레이아웃을 개발하고자하는 응용 프로그램의 중간에 오전 :안드로이드 수평 및 수직 레이아웃 개발
이 레이아웃 스크롤 수직뿐만 아니라 수평으로. 나는 스크롤 뷰를 가져 와서 테이블 뷰 아래에 놓을 생각 이었지만, 수평으로 스크롤 할 수있게하는 방법도 생각했다. 데이터가 웹 서비스에서 오므로 어떤 양의 데이터가 올지 알 수 없습니다.
그래서 안내해주세요.
이것은 바보 같은 질문이지만 나는 같은 레이아웃을 개발하고자하는 응용 프로그램의 중간에 오전 :안드로이드 수평 및 수직 레이아웃 개발
이 레이아웃 스크롤 수직뿐만 아니라 수평으로. 나는 스크롤 뷰를 가져 와서 테이블 뷰 아래에 놓을 생각 이었지만, 수평으로 스크롤 할 수있게하는 방법도 생각했다. 데이터가 웹 서비스에서 오므로 어떤 양의 데이터가 올지 알 수 없습니다.
그래서 안내해주세요.
두 개의 스크롤보기를 사용하는 것은 좋지 않습니다.
<ScrollView
android:id="@+id/scrollview_vertical_table"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<HorizontalScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:ignore="UselessParent" >
<TableLayout
android:id="@+id/tablelayout"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:stretchColumns="*" >
</TableLayout>
</HorizontalScrollView>
</LinearLayout>
</ScrollView>
그리고이 표에서 프로그래밍 방식으로 기록이나 행을 삽입 :
뿐만를 XML 레이아웃 만들기 :이 당신을 도울 것입니다
TableLayout tableLayoutTransactionLineHeading = (TableLayout) findViewById(R.id.tablelayout);
for(int j=0; j<rows; j++){
TableRow tableRow = new TableRow(this);
tableRow.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.WRAP_CONTENT));
TextView lineno = new TextView(this);
lineno.setText(lineNo[j]);
lineno.setPadding(10, 10, 10, 10);
lineno.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
tableRow.addView(lineno);
View v = new View(this);
v.setLayoutParams(new TableRow.LayoutParams(1, TableRow.LayoutParams.MATCH_PARENT));
v.setBackgroundColor(Color.rgb(50, 50, 50));
tableRow.addView(v);
tableLayout.addView(tableRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT,0f));
}
희망이 필요하지만 하나의 일을 할 수 .
수평 및 수직으로 스크롤하는 것이 좋지 않은 경험입니다. 나는 너에게 단 한가지, 너의 모범에서 볼 수있는 것을 수평 한 것으로 보았다. 두 셀을 모두 가져야하는 경우 셀을 만들 때 ListView를 만들고 어댑터에 가로 ScrollView를 배치하여 가로 ScrollView의 뷰 자식을 부풀릴 수있는 위치를 지정할 수 있습니다.
안녕하세요. 다음 튜토리얼을 구현해보세요. http : //android-pro.blogspot.com/2010/02/android-scrollview.html – wSakly