私のプロジェクトでは、その段落に段落と質問(オプション付き)を表示する必要があります。各段落には7〜8個の質問が含まれています。今、段落とその段落の質問とオプションを表示するためのリストビューを表示するためのテキストビューを作成しました。問題は、リストビューを表示していない段落を表示しているときです。つまり、リストビューがスクロールして表示されているテキストビュー内の段落の内容に基づいています。この問題を解決するには?テキストビューの代わりに段落を表示するためにリストヘッダを使用する必要がありますか?アンドロイドにリストするヘッダーを作成するには?
public class test extends Activity {
public static ArrayList<ArrayList<String>> paragraphlist = Para.stringList1;
public static ArrayList<ArrayList<String>> alloptionlist = Para.stringList3;
ArrayList<String> arr1;
static List<paragraphlist > listOfparagraphs = new ArrayList<paragraphlist >();
String paradescp,quest;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.thelist);
TextView tv = (TextView)findViewById(R.id.paradesc);
ListView list = (ListView) findViewById(R.id.listlist);
arr1 = new ArrayList<String>();
for(int i=0;i<paragraphlist.size();i++){
arr1 = paragraphlist .get(i) ;
System.out.println("here arr1 "+arr1);
paradescp = arr1.get(4);
quest = arr1.get(2);
tv.setText(paradescp);
listOfparagraphs .add(new paragraphlist(quest));
}
System.out.println("out here arr1 "+listOfparagraphs .size());
lvAdapter adapter = new lvAdapter(this,listOfparagraphs);
list.setAdapter(adapter);
}
}
scrollviewとtextviewをscrollviewの後ろに置いて、layout_weight = 1と両方を与えてみてはどうでしょうか? – Hiral
こんにちは私たちはそれを保つことができますか?それは正しい手順ですか?もしそうなら、私はそのようにするでしょう...私に教えてください... – RaagaSudha