开发者

problem with spinner

what did I do wrong? My spinner was filled in, but I see only amount of lines, which corresponds the amount of data? But I didn't see the name of data.

SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, cursor, new String[] { Manufacturer.colMarke }, new int[] { android.R.id.text1 });
    Spinner marke = (Spinner) findViewById(R.id.spinner2);
    marke.setAdapter(adapter);

And xml

<Spinner
    android:id="@+id/spinn开发者_StackOverflower2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"/>


you forgot ad _id column in your cursor or forgot to call:

adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

before

marke.setAdapter(adapter);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜