私はListContactをタブコントネットとして割り当てています。すべて正常に動作していますが、リスト項目のすべての結果を確認することはできません。私は2番目のアイテムの半分にしか表示されていない、2番目のアイテムのみを表示しています。私のリストには100個以上のアイテムが含まれています。 推測できますか?Android:リストビュー内のTabHost
+++++ EDIT ++++
Tab view Layout:
================
<?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:background="@drawable/bg" android:layout_height="fill_parent">
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<View android:layout_width="fill_parent" android:layout_height="0.5dip"
android:background="#000" />
<TabWidget android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_marginLeft="0dip" android:layout_marginRight="0dip" />
<View android:layout_width="fill_parent" android:layout_height="2dip"
android:background="#696969" />
<View android:layout_width="fill_parent" android:layout_height="2dip"
android:background="#000" />
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="wrap_content">
</FrameLayout>
</ScrollView>
</LinearLayout>
</TabHost>
</LinearLayout>
Tab Activity:
=============
onCreate():
mTabHost = (android.widget.TabHost) findViewById(android.R.id.tabhost);
mTabHost.setup(getLocalActivityManager());
mTabHost.getTabWidget().setDividerDrawable(R.drawable.tab_divider);
Intent list1Intent = new Intent(LIST1);
View tabview1 = createTabView(mTabHost.getContext(), "Tab1");
mTabHost.addTab(mTabHost.newTabSpec("tab1").setIndicator(tabview1)
.setContent(new Intent(list1Intent)));
View tabview2 = createTabView(mTabHost.getContext(), "Tab2");
mTabHost.addTab(mTabHost.newTabSpec("tab2").setIndicator(tabview2)
.setContent(commentsIntent));
mTabHost.setCurrentTab(0);
LIST1 layout:
=============
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="fill_parent"
android:background="@drawable/bg" android:orientation="vertical"
android:id="@+id/rootView">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/cs_list_empty"
android:text="No Data"></TextView>
<ListView android:id="@+id/android:list" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:cacheColorHint="#00000000"
android:divider="#E6E8E9" android:dividerHeight="2dip"
android:clickable="false" android:choiceMode="none" android:focusable="false" />
</LinearLayout>
おかげで、 ヴェンカトPapana
リストビューをタブホストの外に置くと、すべてのアイテムが表示されますか? – blessenm
はい@blessenm、tabhostの外でうまく動作しています。 –
ログにエラーがある場合は、それを入れてください。または、あなたのコードを入れてください。 – blessenm