0

私はCheckedTextViewでリストビューに取り組んでいますが、

以下は私のコードです:

RelativeLayout parentMostLayout = new RelativeLayout(activity);
    parentMostLayout.setLayoutParams(new AbsListView.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
        RelativeLayout.LayoutParams.WRAP_CONTENT));

CheckedTextView checkedTextView = new CheckedTextView(activity);
int[] attrs = { android.R.attr.listChoiceIndicatorMultiple };
    TypedArray ta = activity.getTheme().obtainStyledAttributes(attrs);
    Drawable indicator = ta.getDrawable(0);
    checkedTextView.setCheckMarkDrawable(indicator);
    ta.recycle();
parentMostLayout.addView(checkedTextView, checkedTextViewlLayoutParams);

そのアイテムが選択しようとしているアイテムをマークしていないことを確認しようとすると、ここで何が問題になる可能性がありますか?

編集

ListView listView = new ListView(activity);
listView.setCacheColorHint(Color.TRANSPARENT);
    listView.setDivider(new ColorDrawable(0x99000000));
    listView.setDividerHeight(1);
listView.setSelector(R.drawable.listselector);
RelativeLayout.LayoutParams listViewParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
        RelativeLayout.LayoutParams.MATCH_PARENT);
listViewParams.addRule(RelativeLayout.ABOVE, footerBar.getId());
4

1 に答える 1