わかりましたので、同じ問題を抱えた他の投稿を見てきましたが、何が間違っているのかまだわかりません。これが私のコードです:
ListView list = (ListView) getView().findViewById(R.id.listView);
String[] stringArray = new String[] { "Bright Mode", "Normal Mode","Bright Mode",
"hey Mode","Bright Mode", "Normal Mode","Bright Mode", "Normal Mode","Bright Mode", "Normal Mode","Bright Mode",
"hey Mode","Bright Mode", "Normal Mode","Bright Mode", "Normal Mode","Bright Mode", "Normal Mode","Bright Mode",
"hey Mode","Bright Mode", "Normal Mode","Bright Mode", "Normal Mode","Bright Mode", "Normal Mode","Bright Mode",
"hey Mode","Bright Mode", "Normal Mode","Bright Mode", "Normal Mode","end", "Bright Mode", "Normal Mode","Bright Mode",
"hey Mode","Bright Mode", "Normal Mode","Bright Mode", "Normal Mode", "end2" };
ArrayAdapter<String> modeAdapter = new ArrayAdapter<String>(getView().getContext(), R.layout.document_list_view, stringArray);
list.setAdapter(modeAdapter);
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> a, View v, int position, long id) {
Toast.makeText(getView().getContext(), "Clicked", Toast.LENGTH_LONG).show();
}
});
クリックは問題なく機能しますが、コンテンツが画面からはみ出し、スクロールできません。これが私のXMLです。スクロールビューなどの中にはありません。
document_list_view:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:id="@+id/listText"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_height="wrap_content"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:textColor="@color/black">
</TextView>
ページのレイアウト:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="1000dp"
android:layout_height="600dp">
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ListView>
</LinearLayout>