안드로이드 개발 질문/답변
(글 수 45,052)
현재 ListActivity를 사용하는게 아니라.
ListView를 사용하여 출력하는데..
전체가 5개 row면 노출되는 row가 한줄 정도 밖에 안 됩니다.
그림을 첨부하면 이해가 잘 될 텐데.. 첨부가 안되네요.
도움 부탁드립니다.
소스 코드는
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
//리스트 뷰 추가
LinearLayout listlayout = new LinearLayout(this);
listlayout.setOrientation(LinearLayout.VERTICAL);
listlayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
SListView listview = new SListView(this);
//타입1
ArrayList<SListRow> items = new ArrayList<SListRow>();
items.add(new SListRow("아이디 ", "으그그ㅡ"));
items.add(new SListRow("아이디 2", "으그그ㅡ"));
items.add(new SListRow("아이디 3", "으그그ㅡ"));
items.add(new SListRow("아이디4 ", "으그그ㅡ"));
SListAdapter arrayadap = new SListAdapter(this,R.layout.row,items);
listview.setAdapter(arrayadap);
arrayadap.notifyDataSetChanged();
listview.setBackgroundColor(0xffffffff);
ll.addView(listview);
setContentView(ll);
}
ListView를 사용하여 출력하는데..
전체가 5개 row면 노출되는 row가 한줄 정도 밖에 안 됩니다.
그림을 첨부하면 이해가 잘 될 텐데.. 첨부가 안되네요.
도움 부탁드립니다.
소스 코드는
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
//리스트 뷰 추가
LinearLayout listlayout = new LinearLayout(this);
listlayout.setOrientation(LinearLayout.VERTICAL);
listlayout.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
SListView listview = new SListView(this);
//타입1
ArrayList<SListRow> items = new ArrayList<SListRow>();
items.add(new SListRow("아이디 ", "으그그ㅡ"));
items.add(new SListRow("아이디 2", "으그그ㅡ"));
items.add(new SListRow("아이디 3", "으그그ㅡ"));
items.add(new SListRow("아이디4 ", "으그그ㅡ"));
SListAdapter arrayadap = new SListAdapter(this,R.layout.row,items);
listview.setAdapter(arrayadap);
arrayadap.notifyDataSetChanged();
listview.setBackgroundColor(0xffffffff);
ll.addView(listview);
setContentView(ll);
}