public class ChipsView extends TokenCompleteTextView<ContactList> {
public ChipsView(Context context){
super(context);
}
public ChipsView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ChipsView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
protected View getViewForObject(ContactList list) {
LayoutInflater inflater = (LayoutInflater.from(getContext()));
View view = inflater.inflate(R.layout.chip,(ViewGroup)getParent(), false);
TextView chip =(TextView)view.findViewById(R.id.chipsview);
TextView label = (TextView)view.findViewById(R.id.label);
chip.setText(list.getName());
label.setText(list.getLabel());
return view;
}
}
在这里,我只能将列表中的值添加为芯片视图?如何添加新值以将其显示为芯片视图?