안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세요,
안드로이드 개발 사이트에 Note Sample 프로그램을 좀 수정하려햇는데 맘대로 안되네요.
현재 샘플프로그램은 오른쪽 그림처럼 하나의 리스트 아이템이 작은데 이것을 왼쪽 그림처럼 크게 만들고 싶습니다.
헌데 API Demo 를 봐도 그렇고, 다른 프로그램을 찾아봐도 그런데 어디서 크게 만드는지 모르겠습니다.
안드로이드 한지 이틀밖에 안되서 참 힘드네요...(하지만 재미있다는..) 도움 부탁드리겠습니다 ^_^
2009.04.07 14:21:53
어떤 예제를 보고 계신지 모르지만 ListView의 Adapter에 들어가는 Layout을 바꿔주면 됩니다. 아마 ListView에 들어가는 Adapter를 생성하는 부분에 해당 아이템의 레이아웃을 세팅하는 부분이 있을텐데 그것을 android.R.layout.simple_list_item_1 로 세팅하면 왼쪽과 같은 그림이 나옵니다.
2009.04.07 14:46:22
http://developer.android.com/guide/tutorials/notepad/index.html 에 있는 예제인데요, 이 예제는 ListView의 Adaptor를 설정 안하더군요... 좀 더 봐야겠습니다.. 아직 잘 모르겠네요. 설명 감사드립니다.
2009.04.07 17:03:13
private void fillData() {이 부분에서 R.id.text1을 android.R.id.text1으로 그리고 R.layout.totes_row를 android.R.layout.simple_list_item1으로 바꿔주시면 될듯하네요 :)
// Get all of the notes from the database and create the item list
Cursor c = mDbHelper.fetchAllNotes();
startManagingCursor(c);
String[] from = new String[] { NotesDbAdapter.KEY_TITLE };
int[] to = new int[] { R.id.text1 };
// Now create an array adapter and set it to display using our row
SimpleCursorAdapter notes =
new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);
setListAdapter(notes);
}