사용자 정의 라디오 버튼 (단일 선택 항목 옵션)을 사용하여 사용자 정의 listview (한 이미지 당 하나의 텍스트 &)를 수행하려고합니다.사용자 정의 라디오 버튼이있는 Android 사용자 정의 목록보기
내 코드 :
이listview.setAdapter(new myAdapter(getApplicationContext(),
R.layout.mycontent, text));
내 어댑터 클래스 :
public class myMessageAdapter extends ArrayAdapter<String> {
private LayoutInflater mInflater;
private String[] mText = null;
long id;
private int mViewResourceId;
public myMessageAdapter(Context ctx, int viewResourceId,
ArrayList<String> textList) {
super(ctx, viewResourceId);
mInflater = (LayoutInflater) ctx
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
String[] message = textList.toArray(new String[textList.size()]);
mText = message;
mViewResourceId = viewResourceId;
}
@Override
public int getCount() {
return mText .length;
}
@Override
public String getItem(int position) {
return mText [position];
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
convertView = mInflater.inflate(mViewResourceId, null);
TextView MESSAGE = (TextView) convertView.findViewById(R.id.message);
id = getItemId(position);
MESSAGE.setText(mText [position]);
return convertView;
}
}
내 출력 목록 항목이 있어야한다 : 당신의 getView 팽창 지정 레이아웃에서
<radioButton> <Text> <Image>.Single choice selection.How could i do that?
검사에 대한 모든 이미지 이러한 솔루션에 대한 http://www.mysamplecode.com/2012/07/android-listview-checkbox-example.html은 http : // www.jmanzano.es/blog/?p=166 – kumar