list_view

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

list_view

Postby LJH_Korean » Mon Jan 25, 2010 5:21 am

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_view2);
ListView list = (ListView)findViewById(R.id.listview);
String[] item = {"item1\n", "item2\n" ,"item3\n","item1\n", "item2\n" ,"item3\n","item1\n", "item2\n" ,"item3\n","item1\n", "item2\n" ,"item3\n","item1\n", "item2\n" ,"item3\n","item1\n", "item2\n" ,"item3\n","item1\n", "item2\n" ,"item3\n"};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,item);
list.setAdapter(adapter);
}

/////////////////////////////////////////////////////////////////////

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dip">



<ListView
android:id="@+id/listview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
Attachments
listview.jpg
listview.jpg (44.15 KiB) Viewed 186 times
LJH_Korean
Freshman
Freshman
 
Posts: 2
Joined: Mon Jan 25, 2010 3:56 am
Location: Korea

Top

Problem?

Postby KarlKarlsom » Mon Jan 25, 2010 4:19 pm

What exactly is your problem with this code?
KarlKarlsom
Experienced Developer
Experienced Developer
 
Posts: 55
Joined: Mon Dec 14, 2009 8:40 pm

hi

Postby LJH_Korean » Tue Jan 26, 2010 1:26 am

I fixed this probrem...but

I want to scroll images...for example, subway map?

please let me know

thank you
LJH_Korean
Freshman
Freshman
 
Posts: 2
Joined: Mon Jan 25, 2010 3:56 am
Location: Korea

Postby brain_first » Fri Jan 29, 2010 4:51 am

i think you can use the expandableListView, it's so perfect!!!
brain_first
Freshman
Freshman
 
Posts: 5
Joined: Fri Dec 25, 2009 2:53 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Majestic-12 [Bot] and 4 guests